3 .
"$srcdir/init.sh"; path_prepend_ .
5 # Test NULL prefix. Result should not contain a number.
6 test-perror
2>&1 >/dev
/null | LC_ALL
=C
tr -d '\r' > t-perror.tmp
7 grep '[0-9]' t-perror.tmp
> /dev
/null \
8 && fail_
"result should not contain a number"
10 # Test empty prefix. Result should be the same.
11 test-perror
'' 2>&1 >/dev
/null | LC_ALL
=C
tr -d '\r' > t-perror1.tmp
12 diff t-perror.tmp t-perror1.tmp \
13 || fail_
"empty prefix should behave like NULL argument"
15 # Test non-empty prefix.
16 test-perror foo
2>&1 >/dev
/null | LC_ALL
=C
tr -d '\r' > t-perror3.tmp
17 sed -e 's/^/foo: /' < t-perror.tmp
> t-perror2.tmp
18 diff t-perror2.tmp t-perror3.tmp || fail_
"prefix applied incorrectly"
21 test-perror
>out
2>/dev
/null || fail_
"unexpected exit status"
22 test -s out
&& fail_
"unexpected output"