freebsd-dev/tools/regression/usr.bin/sed/regress.sh
Juli Mallett dd281fa589 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.
2002-04-21 01:04:03 +00:00

31 lines
566 B
Bash

# $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