diff options
author | jmallett <jmallett@FreeBSD.org> | 2002-04-21 01:04:03 +0000 |
---|---|---|
committer | jmallett <jmallett@FreeBSD.org> | 2002-04-21 01:04:03 +0000 |
commit | 2ef068fe8da60a604ce69209289f8ca0a5c1e5be (patch) | |
tree | 9f2425f3df780e4a89404b2fe28c9d5ceccc05f0 /tools/regression | |
parent | a1b2db869234d4a75681404213872402743c3e43 (diff) | |
download | FreeBSD-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')
-rw-r--r-- | tools/regression/usr.bin/Makefile | 2 | ||||
-rw-r--r-- | tools/regression/usr.bin/sed/Makefile | 4 | ||||
-rw-r--r-- | tools/regression/usr.bin/sed/regress.G.out | 8 | ||||
-rw-r--r-- | tools/regression/usr.bin/sed/regress.in | 4 | ||||
-rw-r--r-- | tools/regression/usr.bin/sed/regress.psl.out | 1 | ||||
-rw-r--r-- | tools/regression/usr.bin/sed/regress.sh | 30 |
6 files changed, 48 insertions, 1 deletions
diff --git a/tools/regression/usr.bin/Makefile b/tools/regression/usr.bin/Makefile index 48cbdd4..f9a8e11 100644 --- a/tools/regression/usr.bin/Makefile +++ b/tools/regression/usr.bin/Makefile @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR= file2c join jot make uudecode uuencode xargs +SUBDIR= file2c join jot make sed uudecode uuencode xargs .include <bsd.subdir.mk> 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 |