From: Sylvestre Ledru Date: Sun, 26 Jul 2026 14:59:29 +0000 (+0200) Subject: tests: sort: check byte-wise ordering in the C.UTF-8 locale X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=af1ba4244c292c6cf2dfba3c351edd55cc4c46c5;p=thirdparty%2Fcoreutils.git tests: sort: check byte-wise ordering in the C.UTF-8 locale * tests/sort/sort-locale.sh: C.UTF-8 has a UTF-8 codeset but the collation rules of C, so add a case ensuring the ordering there stays byte-wise rather than following the linguistic rules exercised for en_US.iso8859-1 and fr_FR.UTF-8 above. Link: https://github.com/coreutils/coreutils/pull/323 --- diff --git a/tests/sort/sort-locale.sh b/tests/sort/sort-locale.sh index ab71ae0dce..28d680639e 100755 --- a/tests/sort/sort-locale.sh +++ b/tests/sort/sort-locale.sh @@ -51,4 +51,14 @@ if test "$(locale charmap 2>/dev/null)" = UTF-8; then # the opposite of the C/byte order fi +# C.UTF-8 has a UTF-8 codeset but the collation rules of C, +# so ordering must stay byte-wise there. +export LC_ALL=C.UTF-8 +if test "$(locale charmap 2>/dev/null)" = UTF-8; then + printf 'aaé\naaf\nAAF\n' > in || framework_failure_ + printf 'AAF\naaf\naaé\n' > exp || framework_failure_ + sort in > out || fail=1 + compare exp out || fail=1 +fi + Exit $fail