From b02260f7253e9629944c200dd30807719b8bc25e Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 22 Nov 2019 14:55:34 -0800 Subject: printf.test: work around bash 3.2 on the Mac. --- tests/printf.test | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'tests/printf.test') 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' "" "" -- cgit v1.2.3