/[pcre]/code/trunk/RunGrepTest
ViewVC logotype

Diff of /code/trunk/RunGrepTest

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 159 by ph10, Wed May 2 10:27:18 2007 UTC revision 280 by ph10, Wed Dec 5 20:56:03 2007 UTC
# Line 202  elephant" ./testdata/grepinput) >>testtr Line 202  elephant" ./testdata/grepinput) >>testtr
202  echo "---------------------------- Test 49 ------------------------------" >>testtry  echo "---------------------------- Test 49 ------------------------------" >>testtry
203  (cd $srcdir; $valgrind $pcregrep "^(abc|def|ghi|jkl)" ./testdata/grepinputx) >>testtry  (cd $srcdir; $valgrind $pcregrep "^(abc|def|ghi|jkl)" ./testdata/grepinputx) >>testtry
204    
205    echo "---------------------------- Test 50 ------------------------------" >>testtry
206    (cd $srcdir; $valgrind $pcregrep -Mv "brown\sfox" ./testdata/grepinputv) >>testtry
207    
208    echo "---------------------------- Test 51 ------------------------------" >>testtry
209    (cd $srcdir; $valgrind $pcregrep --colour=always jumps ./testdata/grepinputv) >>testtry
210    
211    echo "---------------------------- Test 52 ------------------------------" >>testtry
212    (cd $srcdir; $valgrind $pcregrep --file-offsets 'before|zero|after' ./testdata/grepinput) >>testtry
213    
214    echo "---------------------------- Test 53 ------------------------------" >>testtry
215    (cd $srcdir; $valgrind $pcregrep --line-offsets 'before|zero|after' ./testdata/grepinput) >>testtry
216    
217  # Now compare the results.  # Now compare the results.
218    
219  $cf $srcdir/testdata/grepoutput testtry  $cf $srcdir/testdata/grepoutput testtry
# Line 229  fi Line 241  fi
241    
242  # We go to some contortions to try to ensure that the tests for the various  # We go to some contortions to try to ensure that the tests for the various
243  # newline settings will work in environments where the normal newline sequence  # newline settings will work in environments where the normal newline sequence
244  # is not \n. Note the messy fudge to get printf to write a string that starts  # is not \n. Do not use exported files, whose line endings might be changed.
245  # with a hyphen.  # Instead, create an input file using printf so that its contents are exactly
246    # what we want. Note the messy fudge to get printf to write a string that
247    # starts with a hyphen.
248    
249  echo "Testing pcregrep newline settings"  echo "Testing pcregrep newline settings"
250    printf "abc\rdef\r\nghi\njkl" >testNinput
 printf "abc\rdef\r\nghi\njkl" >$srcdir/testNinput  
251    
252  printf "%c--------------------------- Test N1 ------------------------------\r\n" - >testtry  printf "%c--------------------------- Test N1 ------------------------------\r\n" - >testtry
253  (cd $srcdir; $valgrind $pcregrep -n -N CR "^(abc|def|ghi|jkl)" testNinput) >>testtry  $valgrind $pcregrep -n -N CR "^(abc|def|ghi|jkl)" testNinput >>testtry
254    
255  printf "%c--------------------------- Test N2 ------------------------------\r\n" - >>testtry  printf "%c--------------------------- Test N2 ------------------------------\r\n" - >>testtry
256  (cd $srcdir; $valgrind $pcregrep -n --newline=crlf "^(abc|def|ghi|jkl)" testNinput) >>testtry  $valgrind $pcregrep -n --newline=crlf "^(abc|def|ghi|jkl)" testNinput >>testtry
257    
258  printf "%c--------------------------- Test N3 ------------------------------\r\n" - >>testtry  printf "%c--------------------------- Test N3 ------------------------------\r\n" - >>testtry
259  pattern=`printf 'def\rjkl'`  pattern=`printf 'def\rjkl'`
260  (cd $srcdir; $valgrind $pcregrep -n --newline=cr -F "$pattern" testNinput) >>testtry  $valgrind $pcregrep -n --newline=cr -F "$pattern" testNinput >>testtry
261    
262  printf "%c--------------------------- Test N4 ------------------------------\r\n" - >>testtry  printf "%c--------------------------- Test N4 ------------------------------\r\n" - >>testtry
263  pattern=`printf 'xxx\r\njkl'`  pattern=`printf 'xxx\r\njkl'`
264  (cd $srcdir; $valgrind $pcregrep -n --newline=crlf -F "$pattern" testNinput) >>testtry  $valgrind $pcregrep -n --newline=crlf -F "$pattern" testNinput >>testtry
265    
266  printf "%c--------------------------- Test N5 ------------------------------\r\n" - >>testtry  printf "%c--------------------------- Test N5 ------------------------------\r\n" - >>testtry
267  (cd $srcdir; $valgrind $pcregrep -n --newline=any "^(abc|def|ghi|jkl)" testNinput) >>testtry  $valgrind $pcregrep -n --newline=any "^(abc|def|ghi|jkl)" testNinput >>testtry
268    
269  printf "%c--------------------------- Test N6 ------------------------------\r\n" - >>testtry  printf "%c--------------------------- Test N6 ------------------------------\r\n" - >>testtry
270  (cd $srcdir; $valgrind $pcregrep -n --newline=anycrlf "^(abc|def|ghi|jkl)" testNinput) >>testtry  $valgrind $pcregrep -n --newline=anycrlf "^(abc|def|ghi|jkl)" testNinput >>testtry
271    
272  $cf $srcdir/testdata/grepoutputN testtry  $cf $srcdir/testdata/grepoutputN testtry
273  if [ $? != 0 ] ; then exit 1; fi  if [ $? != 0 ] ; then exit 1; fi

Legend:
Removed from v.159  
changed lines
  Added in v.280

  ViewVC Help
Powered by ViewVC 1.1.5