Add tests for pick
[mmh] / test / tests / pick / test-output-on-error
diff --git a/test/tests/pick/test-output-on-error b/test/tests/pick/test-output-on-error
new file mode 100644 (file)
index 0000000..8d96224
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/sh
+######################################################
+#
+# Test output is handelt corect and ``0'' is giving to stdout.
+#
+######################################################
+
+expected_err=$MH_TEST_DIR/$$.expected_err
+expected_out=$MH_TEST_DIR/$$.expected_out
+actual_err=$MH_TEST_DIR/$$.actual_err
+actual_out=$MH_TEST_DIR/$$.actual_out
+
+# A zero should go to standard out to protect other programms
+cat > $expected_out <<EOF
+0
+EOF
+# Error message should go to stderr.
+cat > $expected_err <<EOF
+pick: no messages match specification
+EOF
+
+pick -after tomorrow > $actual_out 2> $actual_err
+diff -u $expected_err $actual_err
+diff -u $expected_out $actual_out