find:: get rid of nested function (it's a gcc-ism)
[oweals/busybox.git] / testsuite / printf.tests
index a5c71ec9d427962ec4fac24c0ac813d889f4d084..9a3c8747361b139a6e7e6fec228bbab83ed5dd7d 100755 (executable)
@@ -1,8 +1,8 @@
 #!/bin/sh
 # Copyright 2008 by Denys Vlasenko
-# Licensed under GPL v2, see file LICENSE for details.
+# Licensed under GPLv2, see file LICENSE in this source tree.
 
-. testing.sh
+. ./testing.sh
 
 # Need this in order to not execute shell builtin
 bb="busybox "
@@ -74,20 +74,25 @@ testing "printf understands %ld" \
        "-5\n""0\n" \
        "" ""
 
-# We are "more correct" here than bash/coreutils: they happily print -2
-# as if it is a huge unsigned number
-testing "printf handles %u -N" \
-       "${bb}printf '%u\n' 1 -2 3 2>&1; echo \$?" \
-       "1\n""printf: -2: invalid number\n""0\n""3\n""0\n" \
+testing "printf understands %Ld" \
+       "${bb}printf '%Ld\n' -5 2>&1; echo \$?" \
+       "-5\n""0\n" \
        "" ""
 
-# Actually, we are wrong here: exit code should be 1
+# "FIXED" now to act compatibly
+## We are "more correct" here than bash/coreutils: they happily print -2
+## as if it is a huge unsigned number
+#testing "printf handles %u -N" \
+#      "${bb}printf '%u\n' 1 -2 3 2>&1; echo \$?" \
+#      "1\n""printf: -2: invalid number\n""0\n""3\n""0\n" \
+#      "" ""
+
 testing "printf handles %d bad_input" \
        "${bb}printf '%d\n' 1 - 2 bad 3 123bad 4 2>&1; echo \$?" \
-"1\n""printf: -: invalid number\n""0\n"\
-"2\n""printf: bad: invalid number\n""0\n"\
-"3\n""printf: 123bad: invalid number\n""0\n"\
-"4\n""0\n" \
+"1\n""printf: invalid number '-'\n""0\n"\
+"2\n""printf: invalid number 'bad'\n""0\n"\
+"3\n""printf: invalid number '123bad'\n""0\n"\
+"4\n""1\n" \
        "" ""
 
 testing "printf aborts on bare %" \