aboutsummaryrefslogtreecommitdiffstats
path: root/false-test
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-03-30 20:29:09 +0200
committerMattias Andrée <maandree@kth.se>2016-03-30 20:29:09 +0200
commit8e47c389e81dd32e020d3739a3d9439beaad37d6 (patch)
treef13c99b666fa8f8236ff88de10d211c80bc2142b /false-test
parentadd printenv test (diff)
downloadbase-util-tests-8e47c389e81dd32e020d3739a3d9439beaad37d6.tar.gz
base-util-tests-8e47c389e81dd32e020d3739a3d9439beaad37d6.tar.bz2
base-util-tests-8e47c389e81dd32e020d3739a3d9439beaad37d6.tar.xz
some improvements
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rwxr-xr-xfalse-test/test28
1 files changed, 20 insertions, 8 deletions
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"
}