From 603daf1171caffd26705cf5c83d5deebf02bfd71 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 11 Oct 2015 21:27:50 -0700 Subject: [PATCH] tests: add test case for Bug#21670 * tests/options: Add test #4 to catch Bug#21670. Also, do not overescape # in shell strings. --- tests/options | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/options b/tests/options index f2c7126..249e20c 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 -- 2.1.0