From b03bb1d9c9cd73aeac2b4003115b5546905433cd Mon Sep 17 00:00:00 2001 From: Philipp Takacs Date: Sat, 17 Jan 2015 01:01:57 +0100 Subject: [PATCH] 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. --- test/tests/pick/test-normal-output | 31 +++++++++++++++++++++++++++++++ test/tests/pick/test-output-on-error | 24 ++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 test/tests/pick/test-normal-output create mode 100644 test/tests/pick/test-output-on-error 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 -- 1.7.10.4