diff options
author | EuAndreh <eu@euandre.org> | 2021-07-31 16:34:17 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2021-07-31 17:08:00 -0300 |
commit | f8eae5c79dab178277732dab802e4011f7fb716b (patch) | |
tree | a44dd91d3d81f1afab504f5adf783e74beebcc77 /src | |
parent | TODOs.md: Add #task-5b4b46b6-b1e8-6ba0-4f26-fab9de6a0e75 (diff) | |
download | gistatic-f8eae5c79dab178277732dab802e4011f7fb716b.tar.gz gistatic-f8eae5c79dab178277732dab802e4011f7fb716b.tar.xz |
tests/submodules/: Add submodule repositories for unit and (future) integration tests
Diffstat (limited to 'src')
-rw-r--r-- | src/gistatic.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/gistatic.c b/src/gistatic.c index 92bcf7d..3464e89 100644 --- a/src/gistatic.c +++ b/src/gistatic.c @@ -911,18 +911,35 @@ cleanup: static void test_last_commit_date() { test_start("test_last_commit_date"); { - testing("embedded Git repository"); + testing("embedded Git repository tests/submodules/repo-1"); struct git_repository *repo; const int e = git_repository_open_ext( &repo, - "tests/resources/embedded-repo", + "tests/submodules/repo-1", GIT_REPOSITORY_OPEN_NO_SEARCH, NULL ); assert(e == 0); char *const date = last_commit_date(repo); assert(date); - assert(strcmp(date, "2021-07-30 14:18") == 0); + assert(strcmp(date, "2021-07-31 19:24") == 0); + free(date); + git_repository_free(repo); + test_ok(); + } + { + testing("embedded Git repository tests/submodules/repo-2"); + struct git_repository *repo; + const int e = git_repository_open_ext( + &repo, + "tests/submodules/repo-2", + GIT_REPOSITORY_OPEN_NO_SEARCH, + NULL + ); + assert(e == 0); + char *const date = last_commit_date(repo); + assert(date); + assert(strcmp(date, "2021-07-31 19:27") == 0); free(date); git_repository_free(repo); test_ok(); |