| Last change
 on this file since 3534 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:
            568 bytes | 
      
      
| Line |  | 
|---|
| 1 | #!/bin/sh | 
|---|
| 2 | # Test Perl regex with context | 
|---|
| 3 | . "${srcdir=.}/init.sh"; path_prepend_ ../src | 
|---|
| 4 | require_pcre_ | 
|---|
| 5 |  | 
|---|
| 6 | cat >in <<'EOF' | 
|---|
| 7 | Preceded by 0 empty lines. | 
|---|
| 8 |  | 
|---|
| 9 | Preceded by 1 empty line. | 
|---|
| 10 |  | 
|---|
| 11 |  | 
|---|
| 12 | Preceded by 2 empty lines. | 
|---|
| 13 |  | 
|---|
| 14 |  | 
|---|
| 15 |  | 
|---|
| 16 | Preceded by 3 empty lines. | 
|---|
| 17 |  | 
|---|
| 18 |  | 
|---|
| 19 |  | 
|---|
| 20 |  | 
|---|
| 21 | Preceded by 4 empty lines. | 
|---|
| 22 |  | 
|---|
| 23 | EOF | 
|---|
| 24 | test $? -eq 0 || framework_failure_ | 
|---|
| 25 |  | 
|---|
| 26 | printf '%s\0' \ | 
|---|
| 27 | 'Preceded by 2 empty lines.' \ | 
|---|
| 28 | 'Preceded by 3 empty lines.' \ | 
|---|
| 29 | 'Preceded by 4 empty lines.' >exp || framework_failure_ | 
|---|
| 30 |  | 
|---|
| 31 | fail=0 | 
|---|
| 32 |  | 
|---|
| 33 | grep -Pzo '(?<=\n\n\n).*' in >out || fail_ 'grep -Pzo failed' | 
|---|
| 34 | compare exp out || fail=1 | 
|---|
| 35 |  | 
|---|
| 36 | Exit $fail | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.