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-w32-bd28f6bf7f53ede8df39112d40cb52f2a3d00177.tar.gz busybox-w32-bd28f6bf7f53ede8df39112d40cb52f2a3d00177.tar.bz2 busybox-w32-bd28f6bf7f53ede8df39112d40cb52f2a3d00177.zip |
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 @@ | |||
5 | 5 | ||
6 | . testing.sh | 6 | . testing.sh |
7 | 7 | ||
8 | # testing "test name" "options" "expected result" "file input" "stdin" | 8 | # testing "test name" "command" "expected result" "file input" "stdin" |
9 | # file input will be file called "input" | 9 | # file input will be file called "input" |
10 | # test can create a file "actual" instead of writing to stdout | 10 | # test can create a file "actual" instead of writing to stdout |
11 | 11 | ||
12 | # Need to call 'busybox test', otherwise shell builtin is used | 12 | # Need to call 'busybox test', otherwise shell builtin is used |
13 | 13 | ||
14 | testing "test ! a = b -a ! c = c: should be false" \ | 14 | testing "test: should be false (1)" \ |
15 | "busybox test; echo \$?" \ | ||
16 | "1\n" \ | ||
17 | "" "" | ||
18 | |||
19 | testing "test '': should be false (1)" \ | ||
20 | "busybox test ''; echo \$?" \ | ||
21 | "1\n" \ | ||
22 | "" "" | ||
23 | |||
24 | testing "test a: should be true (0)" \ | ||
25 | "busybox test a; echo \$?" \ | ||
26 | "0\n" \ | ||
27 | "" "" | ||
28 | |||
29 | testing "test --help: should be true (0)" \ | ||
30 | "busybox test --help; echo \$?" \ | ||
31 | "0\n" \ | ||
32 | "" "" | ||
33 | |||
34 | testing "test -f: should be true (0)" \ | ||
35 | "busybox test -f; echo \$?" \ | ||
36 | "0\n" \ | ||
37 | "" "" | ||
38 | |||
39 | testing "test ! -f: should be false (1)" \ | ||
40 | "busybox test ! -f; echo \$?" \ | ||
41 | "1\n" \ | ||
42 | "" "" | ||
43 | |||
44 | testing "test a = a: should be true (0)" \ | ||
45 | "busybox test a = a; echo \$?" \ | ||
46 | "0\n" \ | ||
47 | "" "" | ||
48 | |||
49 | testing "test -lt = -gt: should be false (1)" \ | ||
50 | "busybox test -lt = -gt; echo \$?" \ | ||
51 | "1\n" \ | ||
52 | "" "" | ||
53 | |||
54 | testing "test -f = a -o b: should be true (0)" \ | ||
55 | "busybox test -f = a -o b; echo \$?" \ | ||
56 | "0\n" \ | ||
57 | "" "" | ||
58 | |||
59 | testing "test ! a = b -a ! c = c: should be false (1)" \ | ||
15 | "busybox test ! a = b -a ! c = c; echo \$?" \ | 60 | "busybox test ! a = b -a ! c = c; echo \$?" \ |
16 | "1\n" \ | 61 | "1\n" \ |
17 | "" \ | 62 | "" "" |
18 | "" \ | ||
19 | 63 | ||
20 | testing "test ! a = b -a ! c = d: should be true" \ | 64 | testing "test ! a = b -a ! c = d: should be true (0)" \ |
21 | "busybox test ! a = b -a ! c = d; echo \$?" \ | 65 | "busybox test ! a = b -a ! c = d; echo \$?" \ |
22 | "0\n" \ | 66 | "0\n" \ |
23 | "" \ | 67 | "" "" |
24 | "" \ | ||
25 | 68 | ||
26 | exit $FAILCOUNT | 69 | exit $FAILCOUNT |