From: Rafał Długołęcki Date: Sat, 16 May 2015 13:52:59 +0000 (+0200) Subject: Improve tests on Option. X-Git-Tag: v0.2.1~8 X-Git-Url: https://git.dlugolecki.net.pl/?p=command.git;a=commitdiff_plain;h=f7958972b1acbc87264ac86323d461b4be115c17 Improve tests on Option. --- diff --git a/tests/command/understand_bool_option.test b/tests/command/understand_bool_option.test index 0a4562d..03a5439 100755 --- a/tests/command/understand_bool_option.test +++ b/tests/command/understand_bool_option.test @@ -8,4 +8,14 @@ for t in 0 1; do fi done +for t in -2 -1 2 3 4 5 15; do + TEST=$($srcdir/command/option_test_command bool=$t) + if [ ! "$?" = "1" ]; then + echo "Command should not understand Option if value is different than: 0 or 1. Got: '$TEST'. Program exited with $? code." + return 1; + fi +done + +echo "Command understand Option correctly." + return 0;