Add more tests for path matching with globs and path delimiters

This commit is contained in:
Antonio Scandurra 2016-03-31 17:38:40 +02:00 committed by Carlos Martín Nieto
parent 029c93464f
commit 0f36271646

View File

@ -132,6 +132,20 @@ void test_attr_ignore__leading_stars(void)
assert_is_ignored(false, "dir1/kid2/file");
}
void test_attr_ignore__globs_and_path_delimiters(void)
{
cl_git_rewritefile("attr/.gitignore", "**/_*/");
assert_is_ignored(false, "test_folder/file");
assert_is_ignored(true, "_test/file");
assert_is_ignored(true, "_test/a/file");
cl_git_rewritefile("attr/.gitignore", "**/_*/foo/bar/*ux");
assert_is_ignored(true, "_test/foo/bar/qux/file");
assert_is_ignored(true, "_test/foo/bar/crux/file");
assert_is_ignored(false, "_test/foo/bar/code/file");
}
void test_attr_ignore__skip_gitignore_directory(void)
{
cl_git_rewritefile("attr/.git/info/exclude", "/NewFolder\n/NewFolder/NewFolder");