1#!/bin/sh
2: ${srcdir=.}
3. "$srcdir/init.sh"; path_prepend_ .
4
5# Test NULL prefix. Result should not contain a number, except in lines that
6# start with 'EDC' (IBM z/OS libc produces an error identifier before the
7# error message).
8${CHECKER} test-perror 2>&1 >/dev/null | LC_ALL=C tr -d '\r' > t-perror.tmp
9grep -v '^EDC' t-perror.tmp | grep '[0-9]' > /dev/null \
10  && fail_ "result should not contain a number"
11
12# Test empty prefix. Result should be the same.
13${CHECKER} test-perror '' 2>&1 >/dev/null | LC_ALL=C tr -d '\r' > t-perror1.tmp
14diff t-perror.tmp t-perror1.tmp \
15  || fail_ "empty prefix should behave like NULL argument"
16
17# Test non-empty prefix.
18${CHECKER} test-perror foo 2>&1 >/dev/null | LC_ALL=C tr -d '\r' > t-perror3.tmp
19sed -e 's/^/foo: /' < t-perror.tmp > t-perror2.tmp
20diff t-perror2.tmp t-perror3.tmp || fail_ "prefix applied incorrectly"
21
22# Test exit status.
23${CHECKER} test-perror >out 2>/dev/null || fail_ "unexpected exit status"
24test -s out && fail_ "unexpected output"
25
26Exit 0
27