From bf950cde6646dfbf4e7550184cde22d4b22185c4 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 4 Jul 2016 02:59:09 -0500 Subject: 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). --- tests/printf.test | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/printf.test') 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" \ + "" "" -- cgit v1.2.3