Tests: Add 3 tags to resources/testrepo. Adjusts refs::list test (including the comments) Adjusts objects::tags::list test
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
diff --git a/tests-clar/object/tag/list.c b/tests-clar/object/tag/list.c
index 75feb55..f57a689 100644
--- a/tests-clar/object/tag/list.c
+++ b/tests-clar/object/tag/list.c
@@ -4,7 +4,7 @@
static git_repository *g_repo;
-#define MAX_USED_TAGS 3
+#define MAX_USED_TAGS 6
struct pattern_match_t
{
@@ -47,7 +47,7 @@ static void ensure_tag_pattern_match(git_repository *repo,
}
}
}
- cl_assert(sucessfully_found == data->expected_matches);
+ cl_assert_equal_i((int)sucessfully_found, (int)data->expected_matches);
exit:
git_strarray_free(&tag_list);
@@ -72,13 +72,13 @@ void test_object_tag_list__list_all(void)
cl_git_pass(git_tag_list(&tag_list, g_repo));
- cl_assert(tag_list.count == 3);
+ cl_assert_equal_i((int)tag_list.count, 6);
git_strarray_free(&tag_list);
}
static const struct pattern_match_t matches[] = {
- { "", 3, { "e90810b", "point_to_blob", "test" } },
+ { "", 6, { "e90810b", "point_to_blob", "test", "packed-tag", "foo/bar", "foo/foo/bar" } },
{ "t*", 1, { "test" } },
{ "*b", 2, { "e90810b", "point_to_blob" } },
{ "e", 0 },
diff --git a/tests-clar/refs/list.c b/tests-clar/refs/list.c
index 2daa394..3948b2b 100644
--- a/tests-clar/refs/list.c
+++ b/tests-clar/refs/list.c
@@ -33,10 +33,10 @@ void test_refs_list__all(void)
printf("# %s\n", ref_list.strings[i]);
}*/
- /* We have exactly 9 refs in total if we include the packed ones:
+ /* We have exactly 12 refs in total if we include the packed ones:
* there is a reference that exists both in the packfile and as
* loose, but we only list it once */
- cl_assert_equal_i((int)ref_list.count, 10);
+ cl_assert_equal_i((int)ref_list.count, 13);
git_strarray_free(&ref_list);
}
@@ -62,7 +62,7 @@ void test_refs_list__do_not_retrieve_references_which_name_end_with_a_lock_exten
"144344043ba4d4a405da03de3844aa829ae8be0e\n");
cl_git_pass(git_reference_list(&ref_list, g_repo, GIT_REF_LISTALL));
- cl_assert_equal_i((int)ref_list.count, 10);
+ cl_assert_equal_i((int)ref_list.count, 13);
git_strarray_free(&ref_list);
}
diff --git a/tests-clar/resources/testrepo/.gitted/packed-refs b/tests-clar/resources/testrepo/.gitted/packed-refs
index 52f5e87..6018a19 100644
--- a/tests-clar/resources/testrepo/.gitted/packed-refs
+++ b/tests-clar/resources/testrepo/.gitted/packed-refs
@@ -1,3 +1,4 @@
# pack-refs with: peeled
41bc8c69075bbdb46c5c6f0566cc8cc5b46e8bd9 refs/heads/packed
5b5b025afb0b4c913b4c338a42934a3863bf3644 refs/heads/packed-test
+b25fa35b38051e4ae45d4222e795f9df2e43f1d1 refs/tags/packed-tag
diff --git a/tests-clar/resources/testrepo/.gitted/refs/tags/foo/bar b/tests-clar/resources/testrepo/.gitted/refs/tags/foo/bar
new file mode 100644
index 0000000..6ee952a
--- /dev/null
+++ b/tests-clar/resources/testrepo/.gitted/refs/tags/foo/bar
@@ -0,0 +1 @@
+b25fa35b38051e4ae45d4222e795f9df2e43f1d1
diff --git a/tests-clar/resources/testrepo/.gitted/refs/tags/foo/foo/bar b/tests-clar/resources/testrepo/.gitted/refs/tags/foo/foo/bar
new file mode 100644
index 0000000..6ee952a
--- /dev/null
+++ b/tests-clar/resources/testrepo/.gitted/refs/tags/foo/foo/bar
@@ -0,0 +1 @@
+b25fa35b38051e4ae45d4222e795f9df2e43f1d1