aboutsummaryrefslogtreecommitdiff
path: root/tests/printf.test
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2016-07-04 02:59:09 -0500
committerRob Landley <rob@landley.net>2016-07-04 02:59:09 -0500
commitbf950cde6646dfbf4e7550184cde22d4b22185c4 (patch)
tree4edd49ed24eebda59352bc1daf8773bd961434e8 /tests/printf.test
parent4e21ddd440f5d1381c96ae6465a12888dcb23446 (diff)
downloadtoybox-bf950cde6646dfbf4e7550184cde22d4b22185c4.tar.gz
Fix a bug (octal digits are 0-7, not 0-8) and deal with a case where posix
is explicitly outright insane (%b handles octal escapes differently for no obvious reason).
Diffstat (limited to 'tests/printf.test')
-rwxr-xr-xtests/printf.test6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/printf.test b/tests/printf.test
index 7b077f0c..a3331748 100755
--- a/tests/printf.test
+++ b/tests/printf.test
@@ -59,3 +59,9 @@ testing "'%g %G' 78 79" "$PRINTF '%g %G' 78 79" "78 79" "" ""
testing "'%s %s' 78 79" "$PRINTF '%s %s' 78 79" "78 79" "" ""
testing "%.s acts like %.0s" "$PRINTF %.s_ 1 2 3 4 5" "_____" "" ""
+testing "corner case" "$PRINTF '\\8'" '\8' '' ''
+
+# The posix spec explicitly specifies inconsistent behavior,
+# so treating the \0066 in %b like the \0066 not in %b is wrong because posix.
+testing "printf posix inconsistency" "$PRINTF '\\0066-%b' '\\0066'" "\x066-6" \
+ "" ""