From 4aca87515a5083ae0e31ce3177189fd43b6d05ac Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sat, 3 Jan 2015 13:58:15 +0100 Subject: patch to Vanilla Tomato 1.28 --- release/src/router/busybox/testsuite/test.tests | 79 +++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100755 release/src/router/busybox/testsuite/test.tests (limited to 'release/src/router/busybox/testsuite/test.tests') diff --git a/release/src/router/busybox/testsuite/test.tests b/release/src/router/busybox/testsuite/test.tests new file mode 100755 index 00000000..b7c84d9b --- /dev/null +++ b/release/src/router/busybox/testsuite/test.tests @@ -0,0 +1,79 @@ +#!/bin/sh + +# Copyright 2007 by Denys Vlasenko +# 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 !: should be true (0)" \ + "busybox test !; echo \$?" \ + "0\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 a -a !: should be true (0)" \ + "busybox test a -a !; echo \$?" \ + "0\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 -- cgit v1.2.3-54-g00ecf