From: Pádraig Brady Date: Mon, 8 Dec 2025 22:32:48 +0000 (+0000) Subject: tests: fix non-portable use of printf '\x..' X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2692d599ec46696dcd69458abb75c9c6a9dd0221;p=thirdparty%2Fcoreutils.git tests: fix non-portable use of printf '\x..' * tests/dd/conv-case.sh: Use octal instead. * tests/ls/hyperlink.sh: Likewise. * tests/sort/sort-locale.sh: Likewise. --- diff --git a/tests/dd/conv-case.sh b/tests/dd/conv-case.sh index d6ece8a2d5..a65d1d58d1 100755 --- a/tests/dd/conv-case.sh +++ b/tests/dd/conv-case.sh @@ -38,8 +38,8 @@ export LC_ALL=en_US.iso8859-1 # only lowercase form works on macOS 10.15.7 if test "$(locale charmap 2>/dev/null | sed 's/iso/ISO-/')" = ISO-8859-1; then # Case conversion should work on all single byte locales. # Check it with é and É in ISO 8859-1. - printf '\xe9\n' > input-lower - printf '\xc9\n' > input-upper + printf '\351\n' > input-lower + printf '\311\n' > input-upper # Check the output when all input characters are already the correct case. dd if=input-lower of=output-lower conv=lcase || fail=1 diff --git a/tests/ls/hyperlink.sh b/tests/ls/hyperlink.sh index 7c4abd511e..a6116ded56 100755 --- a/tests/ls/hyperlink.sh +++ b/tests/ls/hyperlink.sh @@ -45,7 +45,7 @@ mkdir testdir || framework_failure_ cd testdir ls_encoded "testdir" > ../exp.t || framework_failure_ for f in 'an#chor' 'back\slash' 'col:on' 'encoded%3Fquestion' \ - "$(printf 'invalidutf8\xe9')" 'ques?tion' 'sp ace' 'utf8á'; do + "$(printf 'invalidutf8\351')" 'ques?tion' 'sp ace' 'utf8á'; do touch "$f" || framework_failure_ ls_encoded "$f" >> ../exp.t || framework_failure_ done diff --git a/tests/sort/sort-locale.sh b/tests/sort/sort-locale.sh index 4f18e3e28f..b1cdbb8e4b 100755 --- a/tests/sort/sort-locale.sh +++ b/tests/sort/sort-locale.sh @@ -39,7 +39,7 @@ export LC_ALL=en_US.iso8859-1 # only lowercase form works on macOS 10.15.7 if test "$(locale charmap 2>/dev/null | sed 's/iso/ISO-/')" = ISO-8859-1; then check_hard_collate 'a_a' 'a b' # underscore and space considered equal check_hard_collate 'aaa' 'BBB' # case insensitive ordering - check_hard_collate "$(printf 'aa\xe9')" 'aaf' # é comes before f + check_hard_collate "$(printf 'aa\351')" 'aaf' # é comes before f fi export LC_ALL=$LOCALE_FR_UTF8