summaryrefslogtreecommitdiff
path: root/tests/index
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2019-12-03 19:01:00 +1100
committerEdward Thomson <ethomson@edwardthomson.com>2019-12-10 18:10:02 +1000
commit72df1cd84885294aa6961d3710e658969313f902 (patch)
tree404a7c1cf7e8bfa6a715130c8621c821fa3a33e2 /tests/index
parentf3b2860423815050777a731c8dd4714235929075 (diff)
downloadlibgit2-72df1cd84885294aa6961d3710e658969313f902.tar.gz
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.
Diffstat (limited to 'tests/index')
-rw-r--r--tests/index/tests.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/index/tests.c b/tests/index/tests.c
index 33b446ee6..10f2720de 100644
--- a/tests/index/tests.c
+++ b/tests/index/tests.c
@@ -541,7 +541,7 @@ void test_index_tests__add_bypath_to_a_bare_repository_returns_EBAREPO(void)
git_repository_free(bare_repo);
}
-static void add_invalid_filename(git_repository *repo, const char *fn)
+static void assert_add_bypath_fails(git_repository *repo, const char *fn)
{
git_index *index;
git_buf path = GIT_BUF_INIT;
@@ -562,7 +562,7 @@ static void add_invalid_filename(git_repository *repo, const char *fn)
}
/* Test that writing an invalid filename fails */
-void test_index_tests__add_invalid_filename(void)
+void test_index_tests__cannot_add_invalid_filename(void)
{
git_repository *repo;
@@ -577,13 +577,13 @@ void test_index_tests__add_invalid_filename(void)
if (!git_path_exists("./invalid/.GiT"))
cl_must_pass(p_mkdir("./invalid/.GiT", 0777));
- add_invalid_filename(repo, ".git/hello");
- add_invalid_filename(repo, ".GIT/hello");
- add_invalid_filename(repo, ".GiT/hello");
- add_invalid_filename(repo, "./.git/hello");
- add_invalid_filename(repo, "./foo");
- add_invalid_filename(repo, "./bar");
- add_invalid_filename(repo, "subdir/../bar");
+ assert_add_bypath_fails(repo, ".git/hello");
+ assert_add_bypath_fails(repo, ".GIT/hello");
+ assert_add_bypath_fails(repo, ".GiT/hello");
+ assert_add_bypath_fails(repo, "./.git/hello");
+ assert_add_bypath_fails(repo, "./foo");
+ assert_add_bypath_fails(repo, "./bar");
+ assert_add_bypath_fails(repo, "subdir/../bar");
git_repository_free(repo);