GNU bug report logs - #79300
fold-nbsp test failure

Previous Next

Package: coreutils;

Reported by: Bruno Haible <bruno <at> clisp.org>

Date: Sun, 24 Aug 2025 07:51:02 UTC

Severity: normal

Tags: fixed

Done: Collin Funk <collin.funk1 <at> gmail.com>

Full log


Message #17 received at 79300 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Collin Funk <collin.funk1 <at> gmail.com>, 79300 <at> debbugs.gnu.org
Cc: bruno <at> clisp.org
Subject: Re: bug#79300: fold-nbsp test failure
Date: Tue, 26 Aug 2025 10:47:33 +0100
On 26/08/2025 03:24, Collin Funk wrote:
> Bruno Haible via GNU coreutils Bug Reports <bug-coreutils <at> gnu.org>
> writes:
> 
>> Today's CI run reports
>>    FAIL: tests/fold/fold-nbsp
>> on NetBSD 10 and Solaris 11.4.
>>
>> The log output in both cases is:
>>
>> FAIL: tests/fold/fold-nbsp
>> ==========================
>>
>> --- exp1	2025-08-24 06:57:52.605590760 +0000
>> +++ out1	2025-08-24 06:57:52.607333160 +0000
>> @@ -1,3 +1,3 @@
>>   abcdefghij
>> -klmnop qrs
>> -tuvwxyz
>> +klmnop 
>> +qrstuvwxyz
>> --- exp2	2025-08-24 06:57:52.613841250 +0000
>> +++ out2	2025-08-24 06:57:52.615577504 +0000
>> @@ -1,3 +1,3 @@
>>   abcdefghij
>> -klmnop  qr
>> -stuvwxyz
>> +klmnop
>> +qrstuvwxyz
>> FAIL tests/fold/fold-nbsp.sh (exit status: 1)
>>
>>
>> It looks like the &nbsp; character has been treated like a space.
>> If you need a correction at the Gnulib level (in the functions iswblank,
>> iswspace, c32isblank, or c32isspace), please report this to bug-gnulib.
>> Alternatively, you may declare this a "quality of implementation" issue
>> and simply disable the test on NetBSD and Solaris.
> 
> Thanks.
> 
> My initial idea was to check if U+2007 FIGURE SPACE and U+00A0 NO-BREAK
> SPACE are blank using grep. But apparently Solaris grep does not handle
> multibyte characters. Therefore, FIGURE SPACE cannot be checked. :(

Perhaps the techniques from tests/wc/wc-nbsp.sh could be used?
Maybe something like:

check_space() {
  char="$1"
  # Use -L to determine whether NBSP is printable.
  # FreeBSD 11 and OS X treat NBSP as non printable ?
  test "$(env printf "=$char=" | wc -L)" = 3 &&
    test $(env printf "=$char=" | wc -w) = 2
}

if check_space '\u2007'; then
  ...
fi


cheers,
Padraig






This bug report was last modified 10 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.