/[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 239 by ph10, Tue Sep 11 13:46:30 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  # Now compare the results.  # Now compare the results.
212    
213  $cf $srcdir/testdata/grepoutput testtry  $cf $srcdir/testdata/grepoutput testtry
# Line 229  fi Line 235  fi
235    
236  # 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
237  # newline settings will work in environments where the normal newline sequence  # newline settings will work in environments where the normal newline sequence
238  # 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.
239  # with a hyphen.  # Instead, create an input file using printf so that its contents are exactly
240    # what we want. Note the messy fudge to get printf to write a string that
241    # starts with a hyphen.
242    
243  echo "Testing pcregrep newline settings"  echo "Testing pcregrep newline settings"
244    printf "abc\rdef\r\nghi\njkl" >testNinput
 printf "abc\rdef\r\nghi\njkl" >$srcdir/testNinput  
245    
246  printf "%c--------------------------- Test N1 ------------------------------\r\n" - >testtry  printf "%c--------------------------- Test N1 ------------------------------\r\n" - >testtry
247  (cd $srcdir; $valgrind $pcregrep -n -N CR "^(abc|def|ghi|jkl)" testNinput) >>testtry  $valgrind $pcregrep -n -N CR "^(abc|def|ghi|jkl)" testNinput >>testtry
248    
249  printf "%c--------------------------- Test N2 ------------------------------\r\n" - >>testtry  printf "%c--------------------------- Test N2 ------------------------------\r\n" - >>testtry
250  (cd $srcdir; $valgrind $pcregrep -n --newline=crlf "^(abc|def|ghi|jkl)" testNinput) >>testtry  $valgrind $pcregrep -n --newline=crlf "^(abc|def|ghi|jkl)" testNinput >>testtry
251    
252  printf "%c--------------------------- Test N3 ------------------------------\r\n" - >>testtry  printf "%c--------------------------- Test N3 ------------------------------\r\n" - >>testtry
253  pattern=`printf 'def\rjkl'`  pattern=`printf 'def\rjkl'`
254  (cd $srcdir; $valgrind $pcregrep -n --newline=cr -F "$pattern" testNinput) >>testtry  $valgrind $pcregrep -n --newline=cr -F "$pattern" testNinput >>testtry
255    
256  printf "%c--------------------------- Test N4 ------------------------------\r\n" - >>testtry  printf "%c--------------------------- Test N4 ------------------------------\r\n" - >>testtry
257  pattern=`printf 'xxx\r\njkl'`  pattern=`printf 'xxx\r\njkl'`
258  (cd $srcdir; $valgrind $pcregrep -n --newline=crlf -F "$pattern" testNinput) >>testtry  $valgrind $pcregrep -n --newline=crlf -F "$pattern" testNinput >>testtry
259    
260  printf "%c--------------------------- Test N5 ------------------------------\r\n" - >>testtry  printf "%c--------------------------- Test N5 ------------------------------\r\n" - >>testtry
261  (cd $srcdir; $valgrind $pcregrep -n --newline=any "^(abc|def|ghi|jkl)" testNinput) >>testtry  $valgrind $pcregrep -n --newline=any "^(abc|def|ghi|jkl)" testNinput >>testtry
262    
263  printf "%c--------------------------- Test N6 ------------------------------\r\n" - >>testtry  printf "%c--------------------------- Test N6 ------------------------------\r\n" - >>testtry
264  (cd $srcdir; $valgrind $pcregrep -n --newline=anycrlf "^(abc|def|ghi|jkl)" testNinput) >>testtry  $valgrind $pcregrep -n --newline=anycrlf "^(abc|def|ghi|jkl)" testNinput >>testtry
265    
266  $cf $srcdir/testdata/grepoutputN testtry  $cf $srcdir/testdata/grepoutputN testtry
267  if [ $? != 0 ] ; then exit 1; fi  if [ $? != 0 ] ; then exit 1; fi

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

  ViewVC Help
Powered by ViewVC 1.1.5