aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2021-07-31 16:34:17 -0300
committerEuAndreh <eu@euandre.org>2021-07-31 17:08:00 -0300
commitf8eae5c79dab178277732dab802e4011f7fb716b (patch)
treea44dd91d3d81f1afab504f5adf783e74beebcc77 /src
parentTODOs.md: Add #task-5b4b46b6-b1e8-6ba0-4f26-fab9de6a0e75 (diff)
downloadgistatic-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.c23
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();