2 ######################################################
4 # Test that errors are not written to stdout.
6 ######################################################
8 if test -z "${MH_OBJ_DIR}"; then
9 srcdir=`dirname "$0"`/../..
10 MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
13 . "$MH_OBJ_DIR/test/common.sh"
17 expected_err=$MH_TEST_DIR/$$.expected_err
18 expected_out=$MH_TEST_DIR/$$.expected_out
19 actual_err=$MH_TEST_DIR/$$.actual_err
20 actual_out=$MH_TEST_DIR/$$.actual_out
22 # Error message should go to stderr.
23 cat > $expected_err <<EOF
24 pick: -a ambiguous. It matches
28 # Nothing should to go stdout.
29 cat /dev/null > $expected_out
31 pick -a > $actual_out 2> $actual_err
32 check "$expected_err" "$actual_err"
33 check "$expected_out" "$actual_out"