| Last change
 on this file since 3661 was             3529, checked in by bird, 4 years ago | 
        
          | 
Imported grep 3.7 from grep-3.7.tar.gz (sha256: c22b0cf2d4f6bbe599c902387e8058990e1eee99aef333a203829e5fd3dbb342), applying minimal auto-props.
 | 
        
          | 
              
Property                 svn:executable
 set to                 * | 
        
          | File size:
            1.2 KB | 
      
      
| Line |  | 
|---|
| 1 | #! /bin/sh | 
|---|
| 2 | # Test for back-references and other things. | 
|---|
| 3 | # | 
|---|
| 4 | # Copyright (C) 2001, 2006, 2009-2021 Free Software Foundation, Inc. | 
|---|
| 5 | # | 
|---|
| 6 | # Copying and distribution of this file, with or without modification, | 
|---|
| 7 | # are permitted in any medium without royalty provided the copyright | 
|---|
| 8 | # notice and this notice are preserved. | 
|---|
| 9 |  | 
|---|
| 10 | . "${srcdir=.}/init.sh"; path_prepend_ ../src | 
|---|
| 11 |  | 
|---|
| 12 | failures=0 | 
|---|
| 13 |  | 
|---|
| 14 | # checking for a palindrome | 
|---|
| 15 | echo "radar" | grep -e '\(.\)\(.\).\2\1' > /dev/null 2>&1 | 
|---|
| 16 | if test $? -ne 0 ; then | 
|---|
| 17 | echo "Backref: palindrome, test #1 failed" | 
|---|
| 18 | failures=1 | 
|---|
| 19 | fi | 
|---|
| 20 |  | 
|---|
| 21 | # hit hard with the 'Bond' tests | 
|---|
| 22 | # For now, remove the '?' in the last parentheses, so that new glibc can do it. | 
|---|
| 23 | # --Stepan | 
|---|
| 24 | echo "civic" \ | 
|---|
| 25 | | grep -E -e '^(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.).?\9\8\7\6\5\4\3\2\1$' \ | 
|---|
| 26 | > /dev/null 2>&1 | 
|---|
| 27 | if test $? -ne 0 ; then | 
|---|
| 28 | echo "Options: Bond, test #2 failed" | 
|---|
| 29 | failures=1 | 
|---|
| 30 | fi | 
|---|
| 31 |  | 
|---|
| 32 | # backref are local should be error | 
|---|
| 33 | echo "123" | grep -e 'a\(.\)' -e 'b\1' > /dev/null 2>&1 | 
|---|
| 34 | if test $? -ne 2 ; then | 
|---|
| 35 | echo "Backref: Backref not local, test #3 failed" | 
|---|
| 36 | failures=1 | 
|---|
| 37 | fi | 
|---|
| 38 |  | 
|---|
| 39 | # Pattern should fail | 
|---|
| 40 | echo "123" | grep -e '[' -e ']' > /dev/null 2>&1 | 
|---|
| 41 | if test $? -ne 2 ; then | 
|---|
| 42 | echo "Backref: Compiled not local, test #4 failed" | 
|---|
| 43 | failures=1 | 
|---|
| 44 | fi | 
|---|
| 45 |  | 
|---|
| 46 | Exit $failures | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.