Skip to content

Commit 72df1cd

Browse files
committed
test: improve badname verification test
The name of the `add_invalid_filename` function suggests that we _want_ to add an invalid filename. Rename the function to show that we expect to _fail_ to add the invalid filename.
1 parent f3b2860 commit 72df1cd

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

tests/index/tests.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ void test_index_tests__add_bypath_to_a_bare_repository_returns_EBAREPO(void)
541541
git_repository_free(bare_repo);
542542
}
543543

544-
static void add_invalid_filename(git_repository *repo, const char *fn)
544+
static void assert_add_bypath_fails(git_repository *repo, const char *fn)
545545
{
546546
git_index *index;
547547
git_buf path = GIT_BUF_INIT;
@@ -562,7 +562,7 @@ static void add_invalid_filename(git_repository *repo, const char *fn)
562562
}
563563

564564
/* Test that writing an invalid filename fails */
565-
void test_index_tests__add_invalid_filename(void)
565+
void test_index_tests__cannot_add_invalid_filename(void)
566566
{
567567
git_repository *repo;
568568

@@ -577,13 +577,13 @@ void test_index_tests__add_invalid_filename(void)
577577
if (!git_path_exists("./invalid/.GiT"))
578578
cl_must_pass(p_mkdir("./invalid/.GiT", 0777));
579579

580-
add_invalid_filename(repo, ".git/hello");
581-
add_invalid_filename(repo, ".GIT/hello");
582-
add_invalid_filename(repo, ".GiT/hello");
583-
add_invalid_filename(repo, "./.git/hello");
584-
add_invalid_filename(repo, "./foo");
585-
add_invalid_filename(repo, "./bar");
586-
add_invalid_filename(repo, "subdir/../bar");
580+
assert_add_bypath_fails(repo, ".git/hello");
581+
assert_add_bypath_fails(repo, ".GIT/hello");
582+
assert_add_bypath_fails(repo, ".GiT/hello");
583+
assert_add_bypath_fails(repo, "./.git/hello");
584+
assert_add_bypath_fails(repo, "./foo");
585+
assert_add_bypath_fails(repo, "./bar");
586+
assert_add_bypath_fails(repo, "subdir/../bar");
587587

588588
git_repository_free(repo);
589589

0 commit comments

Comments
 (0)