summaryrefslogtreecommitdiff
path: root/tests/ignore/path.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ignore/path.c')
-rw-r--r--tests/ignore/path.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ignore/path.c b/tests/ignore/path.c
index 95269959c..5daf32901 100644
--- a/tests/ignore/path.c
+++ b/tests/ignore/path.c
@@ -560,3 +560,18 @@ void test_ignore_path__escaped_space(void)
assert_is_ignored(false, "bar\\\\\\");
assert_is_ignored(false, "bar\\\\\\ ");
}
+
+void test_ignore_path__invalid_pattern(void)
+{
+ cl_git_rewritefile("attr/.gitignore", "[");
+ assert_is_ignored(false, "[f");
+ assert_is_ignored(false, "f");
+}
+
+void test_ignore_path__negative_prefix_rule(void)
+{
+ cl_git_rewritefile("attr/.gitignore", "ff*\n!f\n");
+ assert_is_ignored(true, "fff");
+ assert_is_ignored(true, "ff");
+ assert_is_ignored(false, "f");
+}