added testsuite for printf by Cristian Ionescu-Idbohrn
authorDenis Vlasenko <vda.linux@googlemail.com>
Thu, 5 Jun 2008 08:27:26 +0000 (08:27 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Thu, 5 Jun 2008 08:27:26 +0000 (08:27 -0000)
testsuite/printf.tests [new file with mode: 0755]

diff --git a/testsuite/printf.tests b/testsuite/printf.tests
new file mode 100755 (executable)
index 0000000..18f25e3
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+set -e
+
+. testing.sh
+
+# Need this in order to not execute shell builtin
+bb="busybox "
+
+# testing "test name" "command" "expected result" "file input" "stdin"
+
+testing "printf produce no further output 1" \
+       "${bb}printf '\c' foo" \
+       "" \
+       "" ""
+
+testing "printf produce no further output 2" \
+       "${bb}printf '%s\c' foo \$HOME" \
+       "foo" \
+       "" ""
+
+testing "printf repeatedly use pattern for each argv" \
+       "${bb}printf '%s\n' foo \$HOME" \
+       "foo\n$HOME\n" \
+       "" ""
+
+exit $FAILCOUNT