From f8eae5c79dab178277732dab802e4011f7fb716b Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sat, 31 Jul 2021 16:34:17 -0300 Subject: tests/submodules/: Add submodule repositories for unit and (future) integration tests --- src/gistatic.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'src') 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(); -- cgit v1.2.3