summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-10-11 21:27:50 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2015-10-11 21:28:39 -0700
commit6eca7d893861c19878ee006e0d5cf9e6e4b3c9b1 (patch)
treefe1ffd2f9c59d7bacab044408531892f0f53310f /tests
parent4f898f22f497d6296c864d17acf9b277761b4ab4 (diff)
downloadgrep-6eca7d893861c19878ee006e0d5cf9e6e4b3c9b1.tar.gz
tests: add test case for Bug#21670
* tests/options: Add test #4 to catch Bug#21670. Also, do not overescape # in shell strings.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/options14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/options b/tests/options
index f2c71268..249e20c2 100755
--- a/tests/options
+++ b/tests/options
@@ -20,21 +20,29 @@ fail=0
# checking for -E extended regex
echo "abababccccccd" | grep -E -e 'c{3}' > /dev/null 2>&1
if test $? -ne 0 ; then
- echo "Options: Wrong status code, test \#1 failed"
+ echo "Options: Wrong status code, test #1 failed"
fail=1
fi
# checking for basic regex
echo "abababccccccd" | grep -G -e 'c\{3\}' > /dev/null 2>&1
if test $? -ne 0 ; then
- echo "Options: Wrong status code, test \#2 failed"
+ echo "Options: Wrong status code, test #2 failed"
fail=1
fi
# checking for fixed string
echo "abababccccccd" | grep -F -e 'c\{3\}' > /dev/null 2>&1
if test $? -ne 1 ; then
- echo "Options: Wrong status code, test \#3 failed"
+ echo "Options: Wrong status code, test #3 failed"
+ fail=1
+fi
+
+# checking for multiple -e options; see:
+# http://bugs.gnu.org/21670
+echo abchelloabc | grep -e '^hello' -e 'hello$' > /dev/null 2>&1
+if test $? -ne 1 ; then
+ echo "Options: Wrong status code, test #4 failed"
fail=1
fi