diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-07-19 08:15:13 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-07-19 08:15:13 +0000 |
commit | bd28f6bf7f53ede8df39112d40cb52f2a3d00177 (patch) | |
tree | 0e2cc7fa0864c8998d4483fc2398a3c3e9791a0f /testsuite | |
parent | 5f116629d80b66bd09d8dc2b849befb1e27cd21a (diff) | |
download | busybox-bd28f6bf7f53ede8df39112d40cb52f2a3d00177.tar.gz |
test: fix parser to prefer binop over unop, as coreutils does.
remove bogus workaround in main(). rename atrocious variables/functions.
much expand testsuite.
libbb: fix --help to not affect "test --help"
function old new delta
run_applet_no_and_exit 421 440 +19
nexpr 817 825 +8
static.no_op - 6 +6
test_main 397 257 -140
------------------------------------------------------------------------------
(add/remove: 2/1 grow/shrink: 2/1 up/down: 104/-211) Total: -107 bytes
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/test.tests | 57 |
1 files changed, 50 insertions, 7 deletions
diff --git a/testsuite/test.tests b/testsuite/test.tests index 351d35565..d4be949ec 100755 --- a/testsuite/test.tests +++ b/testsuite/test.tests @@ -5,22 +5,65 @@ . testing.sh -# testing "test name" "options" "expected result" "file input" "stdin" +# testing "test name" "command" "expected result" "file input" "stdin" # file input will be file called "input" # test can create a file "actual" instead of writing to stdout # Need to call 'busybox test', otherwise shell builtin is used -testing "test ! a = b -a ! c = c: should be false" \ +testing "test: should be false (1)" \ + "busybox test; echo \$?" \ + "1\n" \ + "" "" + +testing "test '': should be false (1)" \ + "busybox test ''; echo \$?" \ + "1\n" \ + "" "" + +testing "test a: should be true (0)" \ + "busybox test a; echo \$?" \ + "0\n" \ + "" "" + +testing "test --help: should be true (0)" \ + "busybox test --help; echo \$?" \ + "0\n" \ + "" "" + +testing "test -f: should be true (0)" \ + "busybox test -f; echo \$?" \ + "0\n" \ + "" "" + +testing "test ! -f: should be false (1)" \ + "busybox test ! -f; echo \$?" \ + "1\n" \ + "" "" + +testing "test a = a: should be true (0)" \ + "busybox test a = a; echo \$?" \ + "0\n" \ + "" "" + +testing "test -lt = -gt: should be false (1)" \ + "busybox test -lt = -gt; echo \$?" \ + "1\n" \ + "" "" + +testing "test -f = a -o b: should be true (0)" \ + "busybox test -f = a -o b; echo \$?" \ + "0\n" \ + "" "" + +testing "test ! a = b -a ! c = c: should be false (1)" \ "busybox test ! a = b -a ! c = c; echo \$?" \ "1\n" \ - "" \ - "" \ + "" "" -testing "test ! a = b -a ! c = d: should be true" \ +testing "test ! a = b -a ! c = d: should be true (0)" \ "busybox test ! a = b -a ! c = d; echo \$?" \ "0\n" \ - "" \ - "" \ + "" "" exit $FAILCOUNT |