summaryrefslogtreecommitdiff
path: root/tests/include-exclude
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2010-03-28 17:32:48 +0200
committerJim Meyering <meyering@redhat.com>2010-03-28 20:59:00 +0200
commitda3d9ebff4400a131448b1548bc5e12d8e701ae3 (patch)
treec8b4c86ac152700138e942891597cc566c7c9d01 /tests/include-exclude
parentc03209e3bb4a64a4ceacf3c02e6ba69cb1457d4d (diff)
downloadgrep-da3d9ebff4400a131448b1548bc5e12d8e701ae3.tar.gz
grep -r: fix --include with non-globs
* lib/savedir.c (savedir): Fix logic error. Introduced by commit bf3bd92c, "build: adapt to the newer exclude API we now get from gnulib" * tests/include-exclude: Test for this bug by exercising --include, too. * NEWS (Bug fixes): Mention it. Reported by Philipp Kohlbecher in http://savannah.gnu.org/bugs/?29358
Diffstat (limited to 'tests/include-exclude')
-rw-r--r--tests/include-exclude5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/include-exclude b/tests/include-exclude
index e77c126d..f4e5d9d2 100644
--- a/tests/include-exclude
+++ b/tests/include-exclude
@@ -12,6 +12,7 @@ printf '%s\n' x/b:b x/dir/d:d > exp-not-a || framework_failure_
printf '%s\n' x/dir/d:d > exp-not-ab || framework_failure_
printf '%s\n' x/a:a x/b:b > exp-not-d || framework_failure_
printf '%s\n' x/a:a x/b:b > exp-not-dir || framework_failure_
+printf '%s\n' x/a:a > exp-a || framework_failure_
grep -r --exclude='a*' . x > out || fail=1
sort out > k && mv k out
@@ -29,4 +30,8 @@ grep -r --exclude-dir=dir . x > out || fail=1
sort out > k && mv k out
compare out exp-not-dir || fail=1
+grep -r --include=a . x > out || fail=1
+# no need to sort
+compare out exp-a || fail=1
+
Exit $fail