]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: ls: fix false failure on FreeBSD
authorPádraig Brady <P@draigBrady.com>
Mon, 16 Mar 2026 22:25:42 +0000 (22:25 +0000)
committerPádraig Brady <P@draigBrady.com>
Mon, 16 Mar 2026 22:25:42 +0000 (22:25 +0000)
* tests/ls/non-utf8-hidden.sh: Avoid sorting in ls, to avoid:
ls: cannot compare file names ...: Illegal byte sequence
seen on FreeBSD 14.
Reported by Bruno Haible.

tests/ls/non-utf8-hidden.sh

index e825af632110a867daccb548670d3e8dd6766182..06dc4084a26ca5e097918f6f95b07a4a418bc663 100755 (executable)
@@ -35,13 +35,13 @@ for loc in C "$LOCALE_FR" "$LOCALE_FR_UTF8"; do
   export LC_ALL="$loc"
 
   # Test 1: Without -a flag, only visible file should appear
-  ls d > out1 || fail=1
+  ls -U d > out1 || fail=1
   echo 'visible' > exp1
   compare exp1 out1 || fail=1
 
   # Test 2: With -a flag, all files including hidden ones should appear
   # The invalid UTF-8 filename will be shown in some escaped form
-  ls -a d > out2 || fail=1
+  ls -a -U d > out2 || fail=1
 
   # Check that we have at least 5 entries (., .., visible, and 2 hidden files)
   line_count=$(wc -l < out2)