bug#65310: test failure on Alpine Linux: tests/sort/sort-debug-keys

2023-08-15 Thread Bruno Haible
Pádraig Brady wrote:
> The fact that ',' isn't used as the decimal point is surprising,
> and is what's causing the test to fail.

Ah, I see. Yes, for some tests one only needs a fr_FR.UTF-8 that supports
UTF-8 in LC_CTYPE, whereas for other tests it also needs to support the
LC_NUMERIC category correctly.

> The attached adds an extra guard to the test to skip this portion
> if ',' is not in fact the decimal point.

Thanks!

Bruno








bug#65310: test failure on Alpine Linux: tests/sort/sort-debug-keys

2023-08-15 Thread Pádraig Brady

On 15/08/2023 14:14, Bruno Haible wrote:

Hi,

Doing "make check" of current coreutils on Alpine Linux 3.18, I see a
test failure that I didn't see with the coreutils-9.3 release:

FAIL: tests/sort/sort-debug-keys

I'm attaching the relevant part of tests/test-suite.log.


In the log we have:

  + LC_ALL=fr_FR.UTF-8 sort --debug -k2g -k1b,1
  sort: text ordering performed using ‘fr_FR.UTF-8’ sorting rules
  sort: note numbers use ‘.’ as a decimal point in this locale

The fact that ',' isn't used as the decimal point is surprising,
and is what's causing the test to fail.
The attached adds an extra guard to the test to skip this portion
if ',' is not in fact the decimal point.

cheers,
PádraigFrom 17e6bcf448890325095cd52d4d9df1b932f27a5a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= 
Date: Tue, 15 Aug 2023 16:44:26 +0100
Subject: [PATCH] tests: fix false failure due to locale on alpine

* 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 | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tests/sort/sort-debug-keys.sh b/tests/sort/sort-debug-keys.sh
index c97c64a10..3397ef8f0 100755
--- a/tests/sort/sort-debug-keys.sh
+++ b/tests/sort/sort-debug-keys.sh
@@ -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
-- 
2.41.0



bug#65310: test failure on Alpine Linux: tests/sort/sort-debug-keys

2023-08-15 Thread Bruno Haible
Hi,

Doing "make check" of current coreutils on Alpine Linux 3.18, I see a
test failure that I didn't see with the coreutils-9.3 release:

FAIL: tests/sort/sort-debug-keys

I'm attaching the relevant part of tests/test-suite.log.

Bruno

==
   GNU coreutils 2023-08-13: ./tests/test-suite.log
==

# TOTAL: 645
# PASS:  431
# SKIP:  211
# XFAIL: 0
# FAIL:  3
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: tests/sort/sort-debug-keys


+ initial_cwd_=/home/bruno/coreutils-2023-08-13/build
+ testdir_prefix_
+ printf gt
+ pfx_=gt
+ mktempd_ /home/bruno/coreutils-2023-08-13/build gt-sort-debug-keys.sh.
+ destdir_=/home/bruno/coreutils-2023-08-13/build
+ template_=gt-sort-debug-keys.sh.
+ MAX_TRIES_=4
+ destdir_slash_=/home/bruno/coreutils-2023-08-13/build/
+ unset TMPDIR
+ d=/home/bruno/coreutils-2023-08-13/build/gt-sort-debug-keys.sh.VmIq
+ :
+ test -d /home/bruno/coreutils-2023-08-13/build/gt-sort-debug-keys.sh.VmIq
+ ls -dgo /home/bruno/coreutils-2023-08-13/build/gt-sort-debug-keys.sh.VmIq
+ perms='drwx--S--- 2 4096 Sep 13 08:45 /home/bruno/coreutils-2023-08-13/build/gt-sort-debug-keys.sh.VmIq'
+ :
+ echo /home/bruno/coreutils-2023-08-13/build/gt-sort-debug-keys.sh.VmIq
+ return
+ test_dir_=/home/bruno/coreutils-2023-08-13/build/gt-sort-debug-keys.sh.VmIq
+ cd /home/bruno/coreutils-2023-08-13/build/gt-sort-debug-keys.sh.VmIq
+ srcdir=../..
+ builddir=..
+ export srcdir builddir
+ gl_init_sh_nl_='
'
+ IFS=' 	
'
+ expr 1 + 128
+ eval 'trap '"'"'Exit 129'"'"' 1'
+ trap 'Exit 129' 1
+ expr 2 + 128
+ eval 'trap '"'"'Exit 130'"'"' 2'
+ trap 'Exit 130' 2
+ expr 3 + 128
+ eval 'trap '"'"'Exit 131'"'"' 3'
+ trap 'Exit 131' 3
+ expr 13 + 128
+ eval 'trap '"'"'Exit 141'"'"' 13'
+ trap 'Exit 141' 13
+ expr 15 + 128
+ eval 'trap '"'"'Exit 143'"'"' 15'
+ trap 'Exit 143' 15
+ saved_IFS=' 	
'
+ IFS=:
+ new_PATH=
+ sep_=
+ test -d /home/bruno/coreutils-2023-08-13/build/src/.
+ new_PATH=/home/bruno/coreutils-2023-08-13/build/src
+ sep_=:
+ test -d /home/bruno/bin/.
+ new_PATH=/home/bruno/coreutils-2023-08-13/build/src:/home/bruno/bin
+ sep_=:
+ test -d /usr/local/bin/.
+ new_PATH=/home/bruno/coreutils-2023-08-13/build/src:/home/bruno/bin:/usr/local/bin
+ sep_=:
+ test -d /usr/sbin/.
+ new_PATH=/home/bruno/coreutils-2023-08-13/build/src:/home/bruno/bin:/usr/local/bin:/usr/sbin
+ sep_=:
+ test -d /usr/bin/.
+ new_PATH=/home/bruno/coreutils-2023-08-13/build/src:/home/bruno/bin:/usr/local/bin:/usr/sbin:/usr/bin
+ sep_=:
+ test -d /sbin/.
+ new_PATH=/home/bruno/coreutils-2023-08-13/build/src:/home/bruno/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin
+ sep_=:
+ test -d /bin/.
+ new_PATH=/home/bruno/coreutils-2023-08-13/build/src:/home/bruno/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+ sep_=:
+ IFS=' 	
'
+ PATH=/home/bruno/coreutils-2023-08-13/build/src:/home/bruno/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+ export PATH
+ trap remove_tmp_ EXIT
+ path_prepend_ ./src
+ test 1 '!=' 0
+ path_dir_=./src
+ abs_path_dir_=/home/bruno/coreutils-2023-08-13/build/./src
+ PATH=/home/bruno/coreutils-2023-08-13/build/./src:/home/bruno/coreutils-2023-08-13/build/src:/home/bruno/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+ create_exe_shims_ /home/bruno/coreutils-2023-08-13/build/./src
+ return 0
+ shift
+ test 0 '!=' 0
+ export PATH
+ print_ver_ sort printf
+ require_built_ sort printf
+ skip_=no
+ test no '=' yes
+ test yes '=' yes
+ local i
+ env sort --version
sort (GNU coreutils) 2023-08-13
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later .
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and Paul Eggert.
+ env printf --version
printf (GNU coreutils) 2023-08-13
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later .
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David MacKenzie.
+ cat
+ sort -s -k2n --debug
sort: text ordering performed using simple byte comparison
sort: key 1 is numeric and spans multiple fields
sort: note numbers use '.' as a decimal point in this locale
+ printf '1\n\n44\n33\n2\n'
+ sort -s -k1.3n --debug
sort: text ordering performed using simple byte comparison
sort: leading blanks are significant in key 1; consider also specifying 'b'
sort: key 1 is numeric and spans multiple fields
sort: note numbers use '.' as a decimal point in this locale
+ printf '1\n\n44\n33\n2\n'
+ sort -s -k1n --debug
sort: text ordering performed using simple byte comparison
sort: key 1 is numeric and spans multiple fields
sort: note numbers use '.' as a decimal point in this locale
+ printf '1\n\n44\n33\n2\n'
+ sort -s -k2g --debug
sort: text ordering