summaryrefslogtreecommitdiff
path: root/testsuite/comm.tests
diff options
context:
space:
mode:
authorDenis Vlasenko2008-07-15 06:45:14 +0000
committerDenis Vlasenko2008-07-15 06:45:14 +0000
commitbb13079c8e9ca7bd86193a220baae1befb053fd6 (patch)
tree81b489bcc56d1fb12d30ae05adcb68d2acc59288 /testsuite/comm.tests
parent51f1b6c0e0160a3c836bc6700c3fa2a43601dfac (diff)
downloadbusybox-bb13079c8e9ca7bd86193a220baae1befb053fd6.zip
busybox-bb13079c8e9ca7bd86193a220baae1befb053fd6.tar.gz
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/comm.tests')
-rwxr-xr-xtestsuite/comm.tests19
1 files changed, 19 insertions, 0 deletions
diff --git a/testsuite/comm.tests b/testsuite/comm.tests
new file mode 100755
index 0000000..44169f9
--- /dev/null
+++ b/testsuite/comm.tests
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# Copyright 2008 by Denys Vlasenko <vda.linux@googlemail.com>
+# Licensed under GPL v2, see file LICENSE for details.
+
+. testing.sh
+
+# testing "description" "command" "result" "infile" "stdin"
+
+testing "comm test 1" "comm input -" "\t123\n""456\n""abc\n""\tdef\n" "456\nabc\n" "123\ndef\n"
+testing "comm test 2" "comm - input" "123\n""\t456\n""\tabc\n""def\n" "456\nabc\n" "123\ndef\n"
+testing "comm test 3" "comm input -" "abc\n""\tdef\n""xyz\n" "abc\nxyz\n" "def\n"
+testing "comm test 4" "comm - input" "\tabc\n""def\n""\txyz\n" "abc\nxyz\n" "def\n"
+testing "comm test 5" "comm input -" "123\n""abc\n""\tdef\n" "123\nabc\n" "def\n"
+testing "comm test 6" "comm - input" "\t123\n""\tabc\n""def\n" "123\nabc\n" "def\n"
+testing "comm unterminated line 1" "comm input -" "abc\n""\tdef\n" "abc" "def"
+testing "comm unterminated line 2" "comm - input" "\tabc\n""def\n" "abc" "def"
+
+exit $FAILCOUNT