summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorDenis Vlasenko2008-02-09 05:48:42 +0000
committerDenis Vlasenko2008-02-09 05:48:42 +0000
commit1e2a7e4ed1ddcd457b6e7e3eebd6a90b7621079e (patch)
tree6949b702f7751c00b72bb24e1af7ca70c9f9c961 /testsuite
parent6d52c1ee24f77690c932dfe8456dfa31e8808f4c (diff)
downloadbusybox-1e2a7e4ed1ddcd457b6e7e3eebd6a90b7621079e.zip
busybox-1e2a7e4ed1ddcd457b6e7e3eebd6a90b7621079e.tar.gz
test: fix mishandling of 'test ! arg1 op arg2 more args'; add testsuite
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/test.tests26
1 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/test.tests b/testsuite/test.tests
new file mode 100755
index 0000000..351d355
--- /dev/null
+++ b/testsuite/test.tests
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# Copyright 2007 by Denys Vlasenko <vda.linux@googlemail.com>
+# Licensed under GPL v2, see file LICENSE for details.
+
+. testing.sh
+
+# testing "test name" "options" "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" \
+ "busybox test ! a = b -a ! c = c; echo \$?" \
+ "1\n" \
+ "" \
+ "" \
+
+testing "test ! a = b -a ! c = d: should be true" \
+ "busybox test ! a = b -a ! c = d; echo \$?" \
+ "0\n" \
+ "" \
+ "" \
+
+exit $FAILCOUNT