Commit 3ace5992 by Carl Dong Committed by Edward Thomson

revparse: Remove error-prone, redundant test

Originally introduced in: 776a6a8e

This test case has recently been fixed in bdab2238, but that fix will only last for a year. Next year the same problem will crop up and the test will need to be re-edited.

This is not ideal as
- This test case becomes an unnecessary burden for developers
- Downstream distros or even just users who want to build older versions of libgit2 are guaranteed to have this test fail

Furthermore, this test case is entirely unnecessary, as the functionality that was originally (see 776a6a8e) intended to be tested is well-covered by subsequent tests which specify a date instead of a "x ago" specification.
parent 1f5e7f9a
...@@ -292,7 +292,7 @@ void test_refs_revparse__upstream(void) ...@@ -292,7 +292,7 @@ void test_refs_revparse__upstream(void)
void test_refs_revparse__ordinal(void) void test_refs_revparse__ordinal(void)
{ {
assert_invalid_single_spec("master@{-2}"); assert_invalid_single_spec("master@{-2}");
/* TODO: make the test below actually fail /* TODO: make the test below actually fail
* cl_git_fail(git_revparse_single(&g_obj, g_repo, "master@{1a}")); * cl_git_fail(git_revparse_single(&g_obj, g_repo, "master@{1a}"));
*/ */
...@@ -400,7 +400,6 @@ void test_refs_revparse__date(void) ...@@ -400,7 +400,6 @@ void test_refs_revparse__date(void)
* a65fedf HEAD@{1335806603 -0900}: commit: * a65fedf HEAD@{1335806603 -0900}: commit:
* be3563a HEAD@{1335806563 -0700}: clone: from /Users/ben/src/libgit2/tests/resour * be3563a HEAD@{1335806563 -0700}: clone: from /Users/ben/src/libgit2/tests/resour
*/ */
test_object("HEAD@{10 years ago}", NULL);
test_object("HEAD@{1 second}", "a65fedf39aefe402d3bb6e24df4d4f5fe4547750"); test_object("HEAD@{1 second}", "a65fedf39aefe402d3bb6e24df4d4f5fe4547750");
test_object("HEAD@{1 second ago}", "a65fedf39aefe402d3bb6e24df4d4f5fe4547750"); test_object("HEAD@{1 second ago}", "a65fedf39aefe402d3bb6e24df4d4f5fe4547750");
...@@ -555,7 +554,7 @@ void test_refs_revparse__a_too_short_objectid_returns_EAMBIGUOUS(void) ...@@ -555,7 +554,7 @@ void test_refs_revparse__a_too_short_objectid_returns_EAMBIGUOUS(void)
/* /*
* $ echo "aabqhq" | git hash-object -t blob --stdin * $ echo "aabqhq" | git hash-object -t blob --stdin
* dea509d0b3cb8ee0650f6ca210bc83f4678851ba * dea509d0b3cb8ee0650f6ca210bc83f4678851ba
* *
* $ echo "aaazvc" | git hash-object -t blob --stdin * $ echo "aaazvc" | git hash-object -t blob --stdin
* dea509d097ce692e167dfc6a48a7a280cc5e877e * dea509d097ce692e167dfc6a48a7a280cc5e877e
*/ */
...@@ -569,11 +568,11 @@ void test_refs_revparse__a_not_precise_enough_objectid_returns_EAMBIGUOUS(void) ...@@ -569,11 +568,11 @@ void test_refs_revparse__a_not_precise_enough_objectid_returns_EAMBIGUOUS(void)
cl_git_mkfile("testrepo/one.txt", "aabqhq\n"); cl_git_mkfile("testrepo/one.txt", "aabqhq\n");
cl_git_mkfile("testrepo/two.txt", "aaazvc\n"); cl_git_mkfile("testrepo/two.txt", "aaazvc\n");
cl_git_pass(git_repository_index(&index, repo)); cl_git_pass(git_repository_index(&index, repo));
cl_git_pass(git_index_add_bypath(index, "one.txt")); cl_git_pass(git_index_add_bypath(index, "one.txt"));
cl_git_pass(git_index_add_bypath(index, "two.txt")); cl_git_pass(git_index_add_bypath(index, "two.txt"));
cl_git_fail_with(git_revparse_single(&obj, repo, "dea509d0"), GIT_EAMBIGUOUS); cl_git_fail_with(git_revparse_single(&obj, repo, "dea509d0"), GIT_EAMBIGUOUS);
cl_git_pass(git_revparse_single(&obj, repo, "dea509d09")); cl_git_pass(git_revparse_single(&obj, repo, "dea509d09"));
...@@ -588,7 +587,7 @@ void test_refs_revparse__issue_994(void) ...@@ -588,7 +587,7 @@ void test_refs_revparse__issue_994(void)
git_repository *repo; git_repository *repo;
git_reference *head, *with_at; git_reference *head, *with_at;
git_object *target; git_object *target;
repo = cl_git_sandbox_init("testrepo.git"); repo = cl_git_sandbox_init("testrepo.git");
cl_assert_equal_i(GIT_ENOTFOUND, cl_assert_equal_i(GIT_ENOTFOUND,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment