aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2019-11-22 14:55:34 -0800
committerRob Landley <rob@landley.net>2019-12-06 12:46:52 -0600
commitb02260f7253e9629944c200dd30807719b8bc25e (patch)
tree583f42575415ddac4d4c57a72eaf5f60d3f81a8b /tests
parent7eaf5d674f32a0301c44e2f0f433aa7144ad1479 (diff)
downloadtoybox-b02260f7253e9629944c200dd30807719b8bc25e.tar.gz
printf.test: work around bash 3.2 on the Mac.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/printf.test9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/printf.test b/tests/printf.test
index a341615e..30525c6b 100755
--- a/tests/printf.test
+++ b/tests/printf.test
@@ -11,10 +11,15 @@
PRINTF="$(which printf)"
testing "text" "$PRINTF TEXT" "TEXT" "" ""
+
+# TODO: we have to use \x1b rather than \e in the expectations because
+# the Mac is stuck on bash 3.2 which doesn't support \e. This can go
+# away when we have a usable toysh.
testing "escapes" "$PRINTF 'one\ntwo\n\v\t\r\f\e\b\athree'" \
- "one\ntwo\n\v\t\r\f\e\b\athree" "" ""
+ "one\ntwo\n\v\t\r\f\x1b\b\athree" "" ""
testing "%b escapes" "$PRINTF %b 'one\ntwo\n\v\t\r\f\e\b\athree'" \
- "one\ntwo\n\v\t\r\f\e\b\athree" "" ""
+ "one\ntwo\n\v\t\r\f\x1b\b\athree" "" ""
+
testing "null" "$PRINTF 'x\0y' | od -An -tx1" ' 78 00 79\n' "" ""
testing "trailing slash" "$PRINTF 'abc\'" 'abc\' "" ""
testing "octal" "$PRINTF ' \1\002\429\045x'" ' \001\002"9%x' "" ""