| 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 testtry $srcdir/testdata/grepoutput |
$cf $srcdir/testdata/grepoutput testtry |
| 220 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
| 221 |
|
|
| 222 |
|
|
| 231 |
echo "---------------------------- Test U2 ------------------------------" >>testtry |
echo "---------------------------- Test U2 ------------------------------" >>testtry |
| 232 |
(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 |
| 233 |
|
|
| 234 |
$cf testtry $srcdir/testdata/grepoutput8 |
$cf $srcdir/testdata/grepoutput8 testtry |
| 235 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
| 236 |
|
|
| 237 |
else |
else |
| 239 |
fi |
fi |
| 240 |
|
|
| 241 |
|
|
| 242 |
# 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 |
| 243 |
# the newlines in the files are not \n. |
# newline settings will work in environments where the normal newline sequence |
| 244 |
|
# is not \n. Do not use exported files, whose line endings might be changed. |
| 245 |
|
# 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 |
| 251 |
|
|
| 252 |
echo "---------------------------- Test N1 ------------------------------" >testtry |
printf "%c--------------------------- Test N1 ------------------------------\r\n" - >testtry |
| 253 |
(cd $srcdir; $valgrind $pcregrep -N CR "^(abc|def|ghi|jkl)" ./testdata/grepinputx) >>testtry |
$valgrind $pcregrep -n -N CR "^(abc|def|ghi|jkl)" testNinput >>testtry |
| 254 |
|
|
| 255 |
echo "---------------------------- Test N2 ------------------------------" >>testtry |
printf "%c--------------------------- Test N2 ------------------------------\r\n" - >>testtry |
| 256 |
(cd $srcdir; $valgrind $pcregrep --newline=crlf "^(abc|def|ghi|jkl)" ./testdata/grepinputx) >>testtry |
$valgrind $pcregrep -n --newline=crlf "^(abc|def|ghi|jkl)" testNinput >>testtry |
| 257 |
|
|
| 258 |
echo "---------------------------- Test N3 ------------------------------" >>testtry |
printf "%c--------------------------- Test N3 ------------------------------\r\n" - >>testtry |
| 259 |
pattern=`printf 'def\rjkl'` |
pattern=`printf 'def\rjkl'` |
| 260 |
(cd $srcdir; $valgrind $pcregrep --newline=cr -F "$pattern" ./testdata/grepinputx) >>testtry |
$valgrind $pcregrep -n --newline=cr -F "$pattern" testNinput >>testtry |
| 261 |
|
|
| 262 |
echo "---------------------------- Test 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 --newline=crlf -F "$pattern" ./testdata/grepinputx) >>testtry |
$valgrind $pcregrep -n --newline=crlf -F "$pattern" testNinput >>testtry |
| 265 |
|
|
| 266 |
|
printf "%c--------------------------- Test N5 ------------------------------\r\n" - >>testtry |
| 267 |
|
$valgrind $pcregrep -n --newline=any "^(abc|def|ghi|jkl)" testNinput >>testtry |
| 268 |
|
|
| 269 |
echo "---------------------------- Test N5 ------------------------------" >>testtry |
printf "%c--------------------------- Test N6 ------------------------------\r\n" - >>testtry |
| 270 |
(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 |
| 271 |
|
|
| 272 |
$cf testtry $srcdir/testdata/grepoutputN |
$cf $srcdir/testdata/grepoutputN testtry |
| 273 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
| 274 |
|
|
| 275 |
exit 0 |
exit 0 |