8d9622404707cc752ccf03d8948f372006d61eb7
[mmh] / test / tests / pick / test-output-on-error
1 #!/bin/sh
2 ######################################################
3 #
4 # Test output is handelt corect and ``0'' is giving to stdout.
5 #
6 ######################################################
7
8 expected_err=$MH_TEST_DIR/$$.expected_err
9 expected_out=$MH_TEST_DIR/$$.expected_out
10 actual_err=$MH_TEST_DIR/$$.actual_err
11 actual_out=$MH_TEST_DIR/$$.actual_out
12
13 # A zero should go to standard out to protect other programms
14 cat > $expected_out <<EOF
15 0
16 EOF
17 # Error message should go to stderr.
18 cat > $expected_err <<EOF
19 pick: no messages match specification
20 EOF
21
22 pick -after tomorrow > $actual_out 2> $actual_err
23 diff -u $expected_err $actual_err
24 diff -u $expected_out $actual_out