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.
This commit is contained in:
Juli Mallett 2002-04-21 01:27:05 +00:00
parent dd281fa589
commit 151740b470
2 changed files with 12 additions and 1 deletions

View File

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

View File

@ -9,12 +9,15 @@ cd $TESTDIR
STATUS=0
for test in G psl; do
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 -
;;