diff options
author | Jim Meyering <jim@meyering.net> | 2004-11-14 00:40:03 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2004-11-14 00:40:03 +0000 |
commit | 1dc343bb3aaf2b47604a10004c70fb8f7c30ed84 (patch) | |
tree | 0a0f5a580584b1ca8e7e1a20935e54e4a72897db /tests/misc | |
parent | efc10a49143ac6d8b68c5cd0aed347baa0cb1229 (diff) | |
download | coreutils-1dc343bb3aaf2b47604a10004c70fb8f7c30ed84.tar.xz |
*** empty log message ***
Diffstat (limited to 'tests/misc')
-rwxr-xr-x | tests/misc/close-stdout | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/misc/close-stdout b/tests/misc/close-stdout index fc92da651..4bdbbcb1d 100755 --- a/tests/misc/close-stdout +++ b/tests/misc/close-stdout @@ -1,5 +1,6 @@ #!/bin/sh # Ensure that several programs work fine, even with stdout initially closed. +# This is effectively a test of closeout.c's close_stdout function. if test "$VERBOSE" = yes; then set -x @@ -23,6 +24,9 @@ fi PATH="$pwd/../..:$PATH" export PATH +fail=0 + +# Ensure these exit successfully, even though stdout is closed. touch a cp a b >&- || fail=1 test -f b || fail=1 @@ -37,4 +41,8 @@ sleep 0 >&- || fail=1 $pwd/../../src/true >&- || fail=1 $pwd/../../src/printf '' >&- || fail=1 +# Ensure these fail, because stdout is closed. +$pwd/../../src/printf 'foo' >&- 2>/dev/null && fail=1 +cp --verbose a b >&- 2>/dev/null && fail=1 + (exit $fail); exit $fail |