From: Philipp Takacs Date: Sat, 17 Jan 2015 00:01:57 +0000 (+0100) Subject: Add tests for pick X-Git-Tag: mmh-0.2-RC1~56^2~8 X-Git-Url: http://git.marmaro.de/?p=mmh;a=commitdiff_plain;h=b03bb1d9c9cd73aeac2b4003115b5546905433cd Add tests for pick Add two patches for pick. One to test the normale behavior, and one to test if a ``0'' is print to stdout when no message is find. --- diff --git a/test/tests/pick/test-normal-output b/test/tests/pick/test-normal-output new file mode 100644 index 0000000..bd1a2e7 --- /dev/null +++ b/test/tests/pick/test-normal-output @@ -0,0 +1,31 @@ +#!/bin/sh +###################################################### +# +# Test that all messages are picked and no ``0'' is giving out. +# +###################################################### + +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 + +# All messages should be go to stdout +cat > $expected_out < $expected_err + +pick > $actual_out 2> $actual_err +diff -u $expected_err $actual_err +diff -u $expected_out $actual_out diff --git a/test/tests/pick/test-output-on-error b/test/tests/pick/test-output-on-error new file mode 100644 index 0000000..8d96224 --- /dev/null +++ b/test/tests/pick/test-output-on-error @@ -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 < $expected_err < $actual_out 2> $actual_err +diff -u $expected_err $actual_err +diff -u $expected_out $actual_out