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

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

  ViewVC Help
Powered by ViewVC 1.1.5