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.
This commit is contained in:
Juli Mallett 2002-04-21 01:04:03 +00:00
parent 6d3ca9de2c
commit dd281fa589
6 changed files with 48 additions and 1 deletions

View File

@ -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>

View File

@ -0,0 +1,4 @@
# $FreeBSD$
all:
@sh ${.CURDIR}/regress.sh ${.CURDIR}

View File

@ -0,0 +1,8 @@
input
data
for validation
of sed(1)

View File

@ -0,0 +1,4 @@
input
data
for validation
of sed(1)

View File

@ -0,0 +1 @@
of sed(1)

View File

@ -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