diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-07-15 06:45:14 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-07-15 06:45:14 +0000 |
commit | bb13079c8e9ca7bd86193a220baae1befb053fd6 (patch) | |
tree | 81b489bcc56d1fb12d30ae05adcb68d2acc59288 /testsuite | |
parent | 51f1b6c0e0160a3c836bc6700c3fa2a43601dfac (diff) | |
download | busybox-w32-bb13079c8e9ca7bd86193a220baae1befb053fd6.tar.gz busybox-w32-bb13079c8e9ca7bd86193a220baae1befb053fd6.tar.bz2 busybox-w32-bb13079c8e9ca7bd86193a220baae1befb053fd6.zip |
comm: almost total rewrite; add testsuite
function old new delta
writeline 128 125 -3
comm_main 540 239 -301
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-304) Total: -304 bytes
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/awk.tests | 3 | ||||
-rwxr-xr-x | testsuite/comm.tests | 19 |
2 files changed, 20 insertions, 2 deletions
diff --git a/testsuite/awk.tests b/testsuite/awk.tests index f69da2cc9..4eabd7595 100755 --- a/testsuite/awk.tests +++ b/testsuite/awk.tests | |||
@@ -1,12 +1,11 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | # awk tests. | ||
4 | # Copyright 2007 by Denys Vlasenko <vda.linux@googlemail.com> | 3 | # Copyright 2007 by Denys Vlasenko <vda.linux@googlemail.com> |
5 | # Licensed under GPL v2, see file LICENSE for details. | 4 | # Licensed under GPL v2, see file LICENSE for details. |
6 | 5 | ||
7 | . testing.sh | 6 | . testing.sh |
8 | 7 | ||
9 | # testing "description" "arguments" "result" "infile" "stdin" | 8 | # testing "description" "command" "result" "infile" "stdin" |
10 | 9 | ||
11 | testing "awk -F case 0" "awk -F '[#]' '{ print NF }'" "" "" "" | 10 | testing "awk -F case 0" "awk -F '[#]' '{ print NF }'" "" "" "" |
12 | testing "awk -F case 1" "awk -F '[#]' '{ print NF }'" "0\n" "" "\n" | 11 | testing "awk -F case 1" "awk -F '[#]' '{ print NF }'" "0\n" "" "\n" |
diff --git a/testsuite/comm.tests b/testsuite/comm.tests new file mode 100755 index 000000000..44169f9b7 --- /dev/null +++ b/testsuite/comm.tests | |||
@@ -0,0 +1,19 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # Copyright 2008 by Denys Vlasenko <vda.linux@googlemail.com> | ||
4 | # Licensed under GPL v2, see file LICENSE for details. | ||
5 | |||
6 | . testing.sh | ||
7 | |||
8 | # testing "description" "command" "result" "infile" "stdin" | ||
9 | |||
10 | testing "comm test 1" "comm input -" "\t123\n""456\n""abc\n""\tdef\n" "456\nabc\n" "123\ndef\n" | ||
11 | testing "comm test 2" "comm - input" "123\n""\t456\n""\tabc\n""def\n" "456\nabc\n" "123\ndef\n" | ||
12 | testing "comm test 3" "comm input -" "abc\n""\tdef\n""xyz\n" "abc\nxyz\n" "def\n" | ||
13 | testing "comm test 4" "comm - input" "\tabc\n""def\n""\txyz\n" "abc\nxyz\n" "def\n" | ||
14 | testing "comm test 5" "comm input -" "123\n""abc\n""\tdef\n" "123\nabc\n" "def\n" | ||
15 | testing "comm test 6" "comm - input" "\t123\n""\tabc\n""def\n" "123\nabc\n" "def\n" | ||
16 | testing "comm unterminated line 1" "comm input -" "abc\n""\tdef\n" "abc" "def" | ||
17 | testing "comm unterminated line 2" "comm - input" "\tabc\n""def\n" "abc" "def" | ||
18 | |||
19 | exit $FAILCOUNT | ||