From 3dc86576481092b03a4b8632a175630af495a26c Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?= Date: Tue, 26 Mar 2024 15:02:17 +0000 Subject: [PATCH] tests: avoid false failure due to mismatched isblank() There is a mismatch between isblank() used by tr and c32isblank() now used by uniq on Solaris 11 OpenIndiana. isblank() was seen to return true for non breaking space, while c32isblank() returned false. Interestingly on Solaris, non breaking space is considered a blank character, and isblank() and c32isblank() honor this in all locales. * tests/uniq/uniq.pl: Adjust the blank check to use join(1) rather than tr(1), as join uses the same blank determination routines as uniq(1). --- tests/uniq/uniq.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/uniq/uniq.pl b/tests/uniq/uniq.pl index 34457b0006..a61f264858 100755 --- a/tests/uniq/uniq.pl +++ b/tests/uniq/uniq.pl @@ -243,8 +243,9 @@ if ( defined $locale && $locale ne 'none' ) { # I've only ever triggered the problem in a non-C locale. - # See if isblank returns true for nbsp. - my $x = qx!env printf '\xa0'| LC_ALL=$locale tr '[:blank:]' x!; + # See if nbsp is considered a blank character + my $x = qx!env printf 'x\xa0y'| LC_ALL=$locale join -a2 -o2.1 /dev/null -!; + chomp $x; # If so, expect just one line of output in the schar test. # Otherwise, expect two. my $in = " y z\n\xa0 y z\n"; -- 2.47.2