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:
parent
6d3ca9de2c
commit
dd281fa589
@ -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>
|
||||
|
4
tools/regression/usr.bin/sed/Makefile
Normal file
4
tools/regression/usr.bin/sed/Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
# $FreeBSD$
|
||||
|
||||
all:
|
||||
@sh ${.CURDIR}/regress.sh ${.CURDIR}
|
8
tools/regression/usr.bin/sed/regress.G.out
Normal file
8
tools/regression/usr.bin/sed/regress.G.out
Normal file
@ -0,0 +1,8 @@
|
||||
input
|
||||
|
||||
data
|
||||
|
||||
for validation
|
||||
|
||||
of sed(1)
|
||||
|
4
tools/regression/usr.bin/sed/regress.in
Normal file
4
tools/regression/usr.bin/sed/regress.in
Normal file
@ -0,0 +1,4 @@
|
||||
input
|
||||
data
|
||||
for validation
|
||||
of sed(1)
|
1
tools/regression/usr.bin/sed/regress.psl.out
Normal file
1
tools/regression/usr.bin/sed/regress.psl.out
Normal file
@ -0,0 +1 @@
|
||||
of sed(1)
|
30
tools/regression/usr.bin/sed/regress.sh
Normal file
30
tools/regression/usr.bin/sed/regress.sh
Normal 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
|
Loading…
x
Reference in New Issue
Block a user