Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/regress/usr.bin/grep Add a test for output when using contex...
details: https://anonhg.NetBSD.org/src/rev/f4cb1480a98e
branches: trunk
changeset: 551958:f4cb1480a98e
user: cjep <cjep%NetBSD.org@localhost>
date: Sun Sep 14 15:10:49 2003 +0000
description:
Add a test for output when using context options and -z.
diffstat:
regress/usr.bin/grep/greptests.sh | 15 ++++++++++++++-
regress/usr.bin/grep/test16a.gnu.out | Bin
regress/usr.bin/grep/test16b.gnu.out | Bin
regress/usr.bin/grep/test16c.gnu.out | Bin
4 files changed, 14 insertions(+), 1 deletions(-)
diffs (34 lines):
diff -r bed9fdc7b74f -r f4cb1480a98e regress/usr.bin/grep/greptests.sh
--- a/regress/usr.bin/grep/greptests.sh Sun Sep 14 14:48:17 2003 +0000
+++ b/regress/usr.bin/grep/greptests.sh Sun Sep 14 15:10:49 2003 +0000
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: greptests.sh,v 1.1.1.1 2003/09/14 13:47:48 cjep Exp $
+# $NetBSD: greptests.sh,v 1.2 2003/09/14 15:10:49 cjep Exp $
#
#
# Regression tests for grep. Some of these tests are based on those
@@ -143,3 +143,16 @@
echo "15. Ignore non-existent files (-s)"
${grep} -s foobar $p/notexistent | diff /dev/null -
echo ""
+
+# Test 16: Context output with -z
+#
+echo "16. Context output with -z"
+tmpdir=`mktemp -d /tmp/greptest.XXXXXX` || exit 1;
+printf "haddock\000cod\000plaice\000" > ${tmpdir}/test1
+printf "mackeral\000cod\000crab\000" > ${tmpdir}/test2
+(cd ${tmpdir} && ${grep} -z -A1 cod test1 test2) | diff $p/test16a.gnu.out -
+(cd ${tmpdir} && ${grep} -z -B1 cod test1 test2) | diff $p/test16b.gnu.out -
+(cd ${tmpdir} && ${grep} -z -C1 cod test1 test2) | diff $p/test16c.gnu.out -
+rm -rf ${tmpdir}
+echo ""
+
diff -r bed9fdc7b74f -r f4cb1480a98e regress/usr.bin/grep/test16a.gnu.out
Binary file regress/usr.bin/grep/test16a.gnu.out has changed
diff -r bed9fdc7b74f -r f4cb1480a98e regress/usr.bin/grep/test16b.gnu.out
Binary file regress/usr.bin/grep/test16b.gnu.out has changed
diff -r bed9fdc7b74f -r f4cb1480a98e regress/usr.bin/grep/test16c.gnu.out
Binary file regress/usr.bin/grep/test16c.gnu.out has changed
Home |
Main Index |
Thread Index |
Old Index