dd281fa589
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.
31 lines
566 B
Bash
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
|