]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: ls: avoid alignment check with non printable characters
authorPádraig Brady <P@draigBrady.com>
Sun, 21 Sep 2025 23:18:28 +0000 (00:18 +0100)
committerPádraig Brady <P@draigBrady.com>
Mon, 22 Sep 2025 10:23:50 +0000 (11:23 +0100)
* tests/ls/block-size.sh: Skip the case where there are
non-printable characters in ls' output, which is the case
with NBSP thousands separators on FreeBSD 11 and 12.
We may drop the MBSW_REJECT_UNPRINTABLE in future from
ls and numfmt, but for now avoid these characters in the test.
Reported by Bruno Haible.

tests/ls/block-size.sh

index 501c7f82be323b4b395e099b9d028b15cc7193d3..d3111c27999b409102c3057755072ea738cba28a 100755 (executable)
@@ -193,6 +193,12 @@ done
 
 # If any of these unavailable, the C fallback should also be aligned
 for loc in sv_SE.UTF-8 $LOCALE_FR_UTF8; do
+
+  # Ensure we have a printable thousands separator
+  # This is not the case on FreeBSD 11/12 at least with NBSP
+  test $(LC_ALL=$loc ls -s1 --block-size=\'k file1M |
+         cut -dK -f1 | LC_ALL=$loc wc -L) = 5 || continue
+
   test $(LC_ALL=$loc ls -s1 --block-size=\'k |
          tail -n+2 | cut -dK -f1 |
          while IFS= read size; do