aboutsummaryrefslogtreecommitdiff
path: root/testsuite/test.tests
diff options
context:
space:
mode:
authorBjørn Mork <bjorn@mork.no>2015-05-15 10:20:47 +0200
committerBjørn Mork <bjorn@mork.no>2015-05-15 10:20:47 +0200
commit73b16af8feec390afbabd9356d6e5e83c0390838 (patch)
tree3730020ba2f9caeb9d7815a975af51830b51ce11 /testsuite/test.tests
busybox: imported from http://www.busybox.net/downloads/busybox-1.13.3.tar.bz2busybox-1.13.3
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Diffstat (limited to 'testsuite/test.tests')
-rwxr-xr-xtestsuite/test.tests69
1 files changed, 69 insertions, 0 deletions
diff --git a/testsuite/test.tests b/testsuite/test.tests
new file mode 100755
index 0000000..d4be949
--- /dev/null
+++ b/testsuite/test.tests
@@ -0,0 +1,69 @@
+#!/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" "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: 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 (0)" \
+ "busybox test ! a = b -a ! c = d; echo \$?" \
+ "0\n" \
+ "" ""
+
+exit $FAILCOUNT