3 . "$srcdir/init.sh"; path_prepend_ .
5 # For now, only test with C locale
9 # Find out how to remove carriage returns from output. Solaris /usr/ucb/tr
10 # does not understand '\r'.
11 if echo solaris | tr -d '\r' | grep solais > /dev/null; then
17 # Test with seekable stdin; the followon process must see remaining data.
18 tr @ '\177' <<EOF > in.tmp
19 nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn - entire line consumed
20 y@n - backspace does not change result
22 does not match either yesexpr or noexpr
35 (test-yesno; test-yesno 3; cat) < in.tmp > out1.tmp || fail=1
36 LC_ALL=C tr -d "$cr" < out1.tmp > out.tmp || fail=1
37 cmp xout.tmp out.tmp || fail=1
39 (test-yesno 3; test-yesno; cat) < in.tmp > out1.tmp || fail=1
40 LC_ALL=C tr -d "$cr" < out1.tmp > out.tmp || fail=1
41 cmp xout.tmp out.tmp || fail=1
43 # Test for behavior on pipe
48 echo yes | test-yesno 2 > out1.tmp || fail=1
49 LC_ALL=C tr -d "$cr" < out1.tmp > out.tmp || fail=1
50 cmp xout.tmp out.tmp || fail=1
52 # Test for behavior on EOF
56 test-yesno </dev/null > out1.tmp || fail=1
57 LC_ALL=C tr -d "$cr" < out1.tmp > out.tmp || fail=1
58 cmp xout.tmp out.tmp || fail=1
60 # Test for behavior when stdin is closed
61 test-yesno 0 <&- > out1.tmp 2> err.tmp && fail=1
62 LC_ALL=C tr -d "$cr" < out1.tmp > out.tmp || fail=1
63 cmp xout.tmp out.tmp || fail=1
64 test -s err.tmp || fail=1