]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: fix false failure due to locale on alpine
authorPádraig Brady <P@draigBrady.com>
Tue, 15 Aug 2023 15:44:26 +0000 (16:44 +0100)
committerPádraig Brady <P@draigBrady.com>
Tue, 15 Aug 2023 21:55:41 +0000 (22:55 +0100)
* tests/sort/sort-debug-keys.sh: Decimal point was seen to be '.'
on fr_FR.UTF-8 on Alpine Linux 3.18, so add an extra guard
to ensure we've a ',' as the decimal point on this locale.
Fixes https://bugs.gnu.org/65310

tests/sort/sort-debug-keys.sh

index c97c64a1021d314efe186fa919602c1ca3760c69..3397ef8f005eff4e1607f267b697339ac2eec413 100755 (executable)
@@ -320,6 +320,8 @@ f=$LOCALE_FR_UTF8
 
 : ${LOCALE_FR_UTF8=none}
 if test "$LOCALE_FR_UTF8" != "none"; then
+ LC_NUMERIC=$f LC_MESSAGES=C sort -g --debug /dev/null 2> debug.out
+ if grep 'numbers use .*,.* as a decimal point' debug.out >/dev/null; then
   (
   echo '   1²---++3   1,234  Mi' |
     LC_ALL=C sort --debug -k2g -k1b,1
@@ -331,7 +333,9 @@ if test "$LOCALE_FR_UTF8" != "none"; then
         -k2,2n -k2,2g -k2,2h \
         -k3,3n -k3,3g -k3,3h
   ) | sed 's/^^ .*/^ no match for key/' > out
-  compare exp out || fail=1
+  compare exp out || touch locale_fail
+ fi
+ test -f locale_fail && fail=1
 fi
 
 Exit $fail