/[pcre]/code/tags/pcre-8.01/RunGrepTest
ViewVC logotype

Diff of /code/tags/pcre-8.01/RunGrepTest

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

revision 142 by ph10, Fri Mar 30 15:55: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 testtry $srcdir/testdata/grepoutput  $cf $srcdir/testdata/grepoutput testtry
211  if [ $? != 0 ] ; then exit 1; fi  if [ $? != 0 ] ; then exit 1; fi
212    
213    
# Line 219  if [ $utf8 -ne 0 ] ; then Line 222  if [ $utf8 -ne 0 ] ; then
222    echo "---------------------------- Test U2 ------------------------------" >>testtry    echo "---------------------------- Test U2 ------------------------------" >>testtry
223    (cd $srcdir; $valgrind $pcregrep -n -u -C 3 --newline=any "Match" ./testdata/grepinput8) >>testtry    (cd $srcdir; $valgrind $pcregrep -n -u -C 3 --newline=any "Match" ./testdata/grepinput8) >>testtry
224    
225    $cf testtry $srcdir/testdata/grepoutput8    $cf $srcdir/testdata/grepoutput8 testtry
226    if [ $? != 0 ] ; then exit 1; fi    if [ $? != 0 ] ; then exit 1; fi
227    
228  else  else
# Line 227  else Line 230  else
230  fi  fi
231    
232    
233  # The tests for various newline values may not work in environments where  # We go to some contortions to try to ensure that the tests for the various
234  # the newlines in the files are not \n.  # newline settings will work in environments where the normal newline sequence
235    # is not \n. Do not use exported files, whose line endings might be changed.
236    # 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
242    
243  echo "---------------------------- Test N1 ------------------------------" >testtry  printf "%c--------------------------- Test N1 ------------------------------\r\n" - >testtry
244  (cd $srcdir; $valgrind $pcregrep -N CR "^(abc|def|ghi|jkl)" ./testdata/grepinputx) >>testtry  $valgrind $pcregrep -n -N CR "^(abc|def|ghi|jkl)" testNinput >>testtry
245    
246  echo "---------------------------- Test N2 ------------------------------" >>testtry  printf "%c--------------------------- Test N2 ------------------------------\r\n" - >>testtry
247  (cd $srcdir; $valgrind $pcregrep --newline=crlf "^(abc|def|ghi|jkl)" ./testdata/grepinputx) >>testtry  $valgrind $pcregrep -n --newline=crlf "^(abc|def|ghi|jkl)" testNinput >>testtry
248    
249  echo "---------------------------- Test N3 ------------------------------" >>testtry  printf "%c--------------------------- Test N3 ------------------------------\r\n" - >>testtry
250  pattern=`printf 'def\rjkl'`  pattern=`printf 'def\rjkl'`
251  (cd $srcdir; $valgrind $pcregrep --newline=cr -F "$pattern" ./testdata/grepinputx) >>testtry  $valgrind $pcregrep -n --newline=cr -F "$pattern" testNinput >>testtry
252    
253  echo "---------------------------- Test 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 --newline=crlf -F "$pattern" ./testdata/grepinputx) >>testtry  $valgrind $pcregrep -n --newline=crlf -F "$pattern" testNinput >>testtry
256    
257    printf "%c--------------------------- Test N5 ------------------------------\r\n" - >>testtry
258    $valgrind $pcregrep -n --newline=any "^(abc|def|ghi|jkl)" testNinput >>testtry
259    
260  echo "---------------------------- Test N5 ------------------------------" >>testtry  printf "%c--------------------------- Test N6 ------------------------------\r\n" - >>testtry
261  (cd $srcdir; $valgrind $pcregrep -n --newline=any "^(abc|def|ghi|jkl)" ./testdata/grepinputx) >>testtry  $valgrind $pcregrep -n --newline=anycrlf "^(abc|def|ghi|jkl)" testNinput >>testtry
262    
263  $cf testtry $srcdir/testdata/grepoutputN  $cf $srcdir/testdata/grepoutputN testtry
264  if [ $? != 0 ] ; then exit 1; fi  if [ $? != 0 ] ; then exit 1; fi
265    
266  exit 0  exit 0

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

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12