summaryrefslogtreecommitdiffstats
path: root/tools/regression/usr.bin/sed
diff options
context:
space:
mode:
authorjmallett <jmallett@FreeBSD.org>2002-04-21 01:04:03 +0000
committerjmallett <jmallett@FreeBSD.org>2002-04-21 01:04:03 +0000
commit2ef068fe8da60a604ce69209289f8ca0a5c1e5be (patch)
tree9f2425f3df780e4a89404b2fe28c9d5ceccc05f0 /tools/regression/usr.bin/sed
parenta1b2db869234d4a75681404213872402743c3e43 (diff)
downloadFreeBSD-src-2ef068fe8da60a604ce69209289f8ca0a5c1e5be.zip
FreeBSD-src-2ef068fe8da60a604ce69209289f8ca0a5c1e5be.tar.gz
Add sed(1) tests for proper behaviour of the G option as fixed in PR 26152,
and for proper behaviour of some sed functions given a nil pattern space, as fixed in PR 34813. The test for G was based on the test in the PR. The nil pattern space test is slightly different as we need to get *some* output, as the core dump will also produce no output (old behaviour) and turn up falsely that the utility is working fine.
Diffstat (limited to 'tools/regression/usr.bin/sed')
-rw-r--r--tools/regression/usr.bin/sed/Makefile4
-rw-r--r--tools/regression/usr.bin/sed/regress.G.out8
-rw-r--r--tools/regression/usr.bin/sed/regress.in4
-rw-r--r--tools/regression/usr.bin/sed/regress.psl.out1
-rw-r--r--tools/regression/usr.bin/sed/regress.sh30
5 files changed, 47 insertions, 0 deletions
diff --git a/tools/regression/usr.bin/sed/Makefile b/tools/regression/usr.bin/sed/Makefile
new file mode 100644
index 0000000..9903670
--- /dev/null
+++ b/tools/regression/usr.bin/sed/Makefile
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+all:
+ @sh ${.CURDIR}/regress.sh ${.CURDIR}
diff --git a/tools/regression/usr.bin/sed/regress.G.out b/tools/regression/usr.bin/sed/regress.G.out
new file mode 100644
index 0000000..49c277c
--- /dev/null
+++ b/tools/regression/usr.bin/sed/regress.G.out
@@ -0,0 +1,8 @@
+input
+
+data
+
+for validation
+
+of sed(1)
+
diff --git a/tools/regression/usr.bin/sed/regress.in b/tools/regression/usr.bin/sed/regress.in
new file mode 100644
index 0000000..2a26e6a
--- /dev/null
+++ b/tools/regression/usr.bin/sed/regress.in
@@ -0,0 +1,4 @@
+input
+data
+for validation
+of sed(1)
diff --git a/tools/regression/usr.bin/sed/regress.psl.out b/tools/regression/usr.bin/sed/regress.psl.out
new file mode 100644
index 0000000..965a13c
--- /dev/null
+++ b/tools/regression/usr.bin/sed/regress.psl.out
@@ -0,0 +1 @@
+of sed(1)
diff --git a/tools/regression/usr.bin/sed/regress.sh b/tools/regression/usr.bin/sed/regress.sh
new file mode 100644
index 0000000..10cc001
--- /dev/null
+++ b/tools/regression/usr.bin/sed/regress.sh
@@ -0,0 +1,30 @@
+# $FreeBSD$
+
+# Go into the regression test directory, handed to us by make(1)
+TESTDIR=$1
+if [ -z "$TESTDIR" ]; then
+ TESTDIR=.
+fi
+cd $TESTDIR
+
+STATUS=0
+
+for test in G psl; do
+ echo "Running test $test"
+ case "$test" in
+ G)
+ sed G < regress.in | diff -u regress.$test.out -
+ ;;
+ psl)
+ sed '$!g; P; D' < regress.in | diff -u regress.$test.out -
+ ;;
+ esac
+ if [ $? -eq 0 ]; then
+ echo "Test $test detected no regression, output matches."
+ else
+ STATUS=$?
+ echo "Test $test failed: regression detected. See above."
+ fi
+done
+
+exit $STATUS
OpenPOWER on IntegriCloud