2 # Test that backrefs are local to regex.
10 # checking for a palindrome
11 echo "radar" | ${GREP} -e '\(.\)\(.\).\2\1' > /dev/null 2>&1
12 if test $? -ne 0 ; then
13 echo "backref: palindrome, test \#1 failed"
17 # hit hard with the `Bond' tests
18 echo "civic" | ${GREP} -E -e '^(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?).?\9\8\7\6\5\4\3\2\1$' > /dev/null 2>&1
19 if test $? -ne 0 ; then
20 echo "Options: Bond, test \#2 failed"
24 # backref are local should be error
25 echo "123" | ${GREP} -e 'a\(.\)' -e 'b\1' > /dev/null 2>&1
26 if test $? -ne 2 ; then
27 echo "Options: Backref not local, test \#3 failed"
31 # Pattern should faile
32 echo "123" | ${GREP} -e '[' -e ']' > /dev/null 2>&1
33 if test $? -ne 2 ; then
34 echo "Options: Compiled not local, test \#3 failed"