4 trap 'rm -fr $tmpfiles' 1 2 3 15
7 tmpfiles="${p}in.tmp ${p}xout.tmp ${p}out.tmp ${p}err.tmp"
9 # For now, only test with C locale
13 # Test with seekable stdin; followon process must see remaining data
14 cat <<EOF > ${p}in.tmp
15 nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn - entire line consumed
16 y
\7fn - backspace does not change result
18 does not match either yesexpr or noexpr
21 cat <<EOF > ${p}xout.tmp
28 (./test-yesno${EXEEXT}; ./test-yesno${EXEEXT} 3; cat) \
29 < ${p}in.tmp > ${p}out.tmp || exit 1
30 cmp ${p}xout.tmp ${p}out.tmp || exit 1
32 (./test-yesno${EXEEXT} 3; ./test-yesno${EXEEXT}; cat) \
33 < ${p}in.tmp > ${p}out.tmp || exit 1
34 cmp ${p}xout.tmp ${p}out.tmp || exit 1
36 # Test for behavior on pipe
37 cat <<EOF > ${p}xout.tmp
41 echo yes | ./test-yesno${EXEEXT} 2 > ${p}out.tmp || exit 1
42 cmp ${p}xout.tmp ${p}out.tmp || exit 1
44 # Test for behavior on EOF
45 cat <<EOF > ${p}xout.tmp
48 ./test-yesno${EXEEXT} </dev/null > ${p}out.tmp || exit 1
49 cmp ${p}xout.tmp ${p}out.tmp || exit 1
51 # Test for behavior when stdin is closed
52 ./test-yesno${EXEEXT} 0 <&- > ${p}out.tmp 2> ${p}err.tmp && exit 1
53 cmp ${p}xout.tmp ${p}out.tmp || exit 1
54 test -s ${p}err.tmp || exit 1