From 8e47c389e81dd32e020d3739a3d9439beaad37d6 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 30 Mar 2016 20:29:09 +0200 Subject: some improvements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- false-test/test | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'false-test/test') diff --git a/false-test/test b/false-test/test index c3e1432..a4f38fd 100755 --- a/false-test/test +++ b/false-test/test @@ -15,53 +15,65 @@ report () fi } +F () +{ + touch tmp1 tmp2; rm tmp1 tmp2 + ! $t "$@" 2> tmp1 >&2 + ret=$? + < tmp1 tee /dev/stderr | grep -v '^==[0-9]*==' > tmp2 + test $ret = 0 && test ! -s tmp2 + ret=$? + rm tmp1 tmp2 + return $ret +} + args0 () { - ! $t + F report $? "args0" } args1 () { - ! $t 1 + F 1 report $? "args1" } args2 () { - ! $t 1 2 + F 1 2 report $? "args2" } args3 () { - ! $t 1 2 3 + F 1 2 3 report $? "args3" } dash () { - ! $t - + F - report $? "dash" } opt () { - ! $t -h + F -h report $? "opt" } ddash () { - ! $t -- + F -- report $? "ddash" } long () { - ! $t --hello + F --hello report $? "long" } -- cgit v1.2.3-70-g09d2