summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko2008-06-05 08:27:26 +0000
committerDenis Vlasenko2008-06-05 08:27:26 +0000
commit50120dab4e78e6531d640fe8f86675f8d06a7467 (patch)
tree2f8b7fef0c9117a79df8a899ab88f0fb8af0eecd
parent7d60fc1c0a96983d0909f50f8db26ca1b770b039 (diff)
downloadbusybox-50120dab4e78e6531d640fe8f86675f8d06a7467.zip
busybox-50120dab4e78e6531d640fe8f86675f8d06a7467.tar.gz
added testsuite for printf by Cristian Ionescu-Idbohrn
-rwxr-xr-xtestsuite/printf.tests27
1 files changed, 27 insertions, 0 deletions
diff --git a/testsuite/printf.tests b/testsuite/printf.tests
new file mode 100755
index 0000000..18f25e3
--- /dev/null
+++ b/testsuite/printf.tests
@@ -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