Removed some unused code having to do with permissions of symlinks.
[mmh] / test / pick / test-stderr
1 #!/bin/sh
2 ######################################################
3 #
4 # Test that errors are not written to stdout.
5 #
6 ######################################################
7
8 if test -z "${MH_OBJ_DIR}"; then
9     srcdir=`dirname "$0"`/../..
10     MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
11 fi
12
13 . "$MH_OBJ_DIR/test/common.sh"
14
15 setup_test
16
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
21
22 # Error message should go to stderr.
23 cat > $expected_err <<EOF
24 pick: -a ambiguous.  It matches
25   -and
26   -after date
27 EOF
28 # Nothing should to go stdout.
29 cat /dev/null > $expected_out
30
31 pick -a > $actual_out 2> $actual_err
32 check "$expected_err" "$actual_err"
33 check "$expected_out" "$actual_out"