]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: fix non-portable use of printf '\x..'
authorPádraig Brady <P@draigBrady.com>
Mon, 8 Dec 2025 22:32:48 +0000 (22:32 +0000)
committerPádraig Brady <P@draigBrady.com>
Mon, 8 Dec 2025 22:32:48 +0000 (22:32 +0000)
* tests/dd/conv-case.sh: Use octal instead.
* tests/ls/hyperlink.sh: Likewise.
* tests/sort/sort-locale.sh: Likewise.

tests/dd/conv-case.sh
tests/ls/hyperlink.sh
tests/sort/sort-locale.sh

index d6ece8a2d5d6898859a91caf80b39af63108f0a3..a65d1d58d1ac7ee1d98e30baf8732ba8a4525638 100755 (executable)
@@ -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
index 7c4abd511e3d9859b91a90569f4ea18c64522580..a6116ded563904d4262b9c4232844c541f77507c 100755 (executable)
@@ -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
index 4f18e3e28fd497d038cb8baafd87346ce4799579..b1cdbb8e4bd7402976b770b8c15c5f87460a94dd 100755 (executable)
@@ -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