3 . "$srcdir/init.sh"; path_prepend_ .
5 echo Hello world > in.tmp
9 # Test with seekable stdin; followon process must see remaining data
10 (test-closein; cat) < in.tmp > out1.tmp || fail=1
11 cmp out1.tmp in.tmp || fail=1
13 (test-closein consume; cat) < in.tmp > out2.tmp || fail=1
14 cmp out2.tmp xout.tmp || fail=1
16 # Test for lack of error on pipe. Ignore any EPIPE failures from cat.
17 cat in.tmp 2>/dev/null | test-closein || fail=1
19 cat in.tmp 2>/dev/null | test-closein consume || fail=1
21 # Test for lack of error when nothing is read
22 test-closein </dev/null || fail=1
24 test-closein <&- || fail=1
26 # Test for no error when EOF is read early
27 test-closein consume </dev/null || fail=1
29 # Test for error when read fails because no file available
30 test-closein consume close <&- 2>/dev/null && fail=1