freebsd-dev/tools/regression/usr.bin/sed/regress.sh
Juli Mallett 151740b470 For the P function, the newline must be considered a part of the pattern
space, so when printing it, don't let the pattern space and the output run
into eachother by omitting the \n when printing.
2002-04-21 01:27:05 +00:00

34 lines
633 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 P psl; do
echo "Running test $test"
case "$test" in
G)
sed G < regress.in | diff -u regress.$test.out -
;;
P)
sed P < 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