ignore: move tests from status to attr ignore suite
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
diff --git a/tests/attr/ignore.c b/tests/attr/ignore.c
index 165e2ba..110304a 100644
--- a/tests/attr/ignore.c
+++ b/tests/attr/ignore.c
@@ -372,3 +372,28 @@ void test_attr_ignore__case_sensitive_unignore_does_nothing(void)
assert_is_ignored(true, "case/file");
}
+
+void test_attr_ignore__ignored_subdirfiles_with_subdir_rule(void)
+{
+ cl_git_rewritefile(
+ "attr/.gitignore",
+ "dir/*\n"
+ "!dir/sub1/sub2/**\n");
+
+ assert_is_ignored(true, "dir/a.test");
+ assert_is_ignored(true, "dir/sub1/a.test");
+ assert_is_ignored(true, "dir/sub1/sub2");
+}
+
+void test_attr_ignore__ignored_subdirfiles_with_negations(void)
+{
+ cl_git_rewritefile(
+ "attr/.gitignore",
+ "dir/*\n"
+ "!dir/a.test\n");
+
+ assert_is_ignored(false, "dir/a.test");
+ assert_is_ignored(true, "dir/b.test");
+ assert_is_ignored(true, "dir/sub1/c.test");
+}
+
diff --git a/tests/status/ignore.c b/tests/status/ignore.c
index a6045b8..4965821 100644
--- a/tests/status/ignore.c
+++ b/tests/status/ignore.c
@@ -1213,43 +1213,3 @@ void test_status_ignore__unignored_subdirs(void)
assert_is_ignored("dir/a.test");
refute_is_ignored("dir/subdir/a.test");
}
-
-void test_status_ignore__ignored_subdirfiles_with_subdir_rule(void)
-{
- static const char *test_files[] = {
- "empty_standard_repo/dir/a.test",
- "empty_standard_repo/dir/sub1/sub2/b.test",
- NULL
- };
-
- make_test_data("empty_standard_repo", test_files);
- cl_git_mkfile(
- "empty_standard_repo/.gitignore",
- "dir/*\n"
- "!dir/sub1/sub2/**\n");
-
- assert_is_ignored("dir/a.test");
- assert_is_ignored("dir/sub1/a.test");
- assert_is_ignored("dir/sub1/sub2");
- assert_is_ignored("dir/sub1/sub2/b.test");
-}
-
-void test_status_ignore__ignored_subdirfiles_with_negations(void)
-{
- static const char *test_files[] = {
- "empty_standard_repo/dir/a.test",
- "empty_standard_repo/dir/b.test",
- "empty_standard_repo/dir/sub1/c.test",
- NULL
- };
-
- make_test_data("empty_standard_repo", test_files);
- cl_git_mkfile(
- "empty_standard_repo/.gitignore",
- "dir/*\n"
- "!dir/a.test\n");
-
- refute_is_ignored("dir/a.test");
- assert_is_ignored("dir/b.test");
- assert_is_ignored("dir/sub1/c.test");
-}