summaryrefslogtreecommitdiff
path: root/tests/attr
diff options
context:
space:
mode:
authorAntonio Scandurra <me@as-cii.com>2016-03-31 17:38:40 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2016-04-18 15:21:43 +0200
commit0f36271646da455150f821582621f7d0d5e04ddf (patch)
tree890e6c033f8735ba6bf4bcbc5b7a93a248f2ea22 /tests/attr
parent029c93464f3124556286ccc46164c1d4181edfcc (diff)
downloadlibgit2-0f36271646da455150f821582621f7d0d5e04ddf.tar.gz
Add more tests for path matching with globs and path delimiters
Diffstat (limited to 'tests/attr')
-rw-r--r--tests/attr/ignore.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/attr/ignore.c b/tests/attr/ignore.c
index 91bf984a1..f11dad570 100644
--- a/tests/attr/ignore.c
+++ b/tests/attr/ignore.c
@@ -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");