bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC PATCH 3/3] tests: add failing test for grep from a directory


From: Paolo Bonzini
Subject: [RFC PATCH 3/3] tests: add failing test for grep from a directory
Date: Sun, 15 Aug 2010 10:58:00 -0400

* tests/Makefile.am (TESTS, XFAIL_TESTS): Add grep-dir.
* tests/grep-dir: New.
---
 tests/Makefile.am |    4 +++-
 tests/grep-dir    |   17 +++++++++++++++++
 2 files changed, 20 insertions(+), 1 deletions(-)
 create mode 100644 tests/grep-dir

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 39eee62..c3e980d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -24,7 +24,8 @@ LDADD = ../lib/libgreputils.a $(LIBINTL) ../lib/libgreputils.a
 
 # Remove this definition once the failing test passes.
 XFAIL_TESTS = \
-  word-delim-multibyte
+  word-delim-multibyte \
+  grep-dir
 
 TESTS =                                                \
   backref.sh                                   \
@@ -47,6 +48,7 @@ TESTS =                                               \
   fmbtest                                      \
   foad1                                                \
   grep-dev-null                                        \
+  grep-dir                                             \
   help-version                                 \
   ignore-mmap                                  \
   include-exclude                              \
diff --git a/tests/grep-dir b/tests/grep-dir
new file mode 100644
index 0000000..e005525
--- /dev/null
+++ b/tests/grep-dir
@@ -0,0 +1,17 @@
+#!/bin/sh
+# Case-insensitive grep with a 0-size input file would fail in grep up to 2.6.3
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+
+mkdir a || framework_failure
+
+echo x | grep -f a/; { test $? -gt 1 && test $? -lt 128; } || fail=1
+echo x | grep -if a/; { test $? -gt 1 && test $? -lt 128; } || fail=1
+echo x | grep -Ff a/; { test $? -gt 1 && test $? -lt 128; } || fail=1
+echo x | grep -Fif a/; { test $? -gt 1 && test $? -lt 128; } || fail=1
+
+grep -f a/ < /dev/null; { test $? -gt 1 && test $? -lt 128; } || fail=1
+grep -if a/ < /dev/null; { test $? -gt 1 && test $? -lt 128; } || fail=1
+grep -Ff a/ < /dev/null; { test $? -gt 1 && test $? -lt 128; } || fail=1
+grep -Fif a/ < /dev/null; { test $? -gt 1 && test $? -lt 128; } || fail=1
+
+Exit $fail
-- 
1.7.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]