]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: avoid false failure with unicode decomposed file systems
authorPádraig Brady <P@draigBrady.com>
Sun, 24 Nov 2024 12:51:43 +0000 (12:51 +0000)
committerPádraig Brady <P@draigBrady.com>
Sun, 24 Nov 2024 12:59:42 +0000 (12:59 +0000)
* tests/ls/dired.sh: macOS normalizes unicode characters to decomposed
(NFD) form when storing names in the file system, which breaks the
round-trip comparison employed by the test.  So instead use a character
which does not decompose; verified with:
  echo æ | uconv -f utf8 -t utf8 -x nfd | od -Ax -tx1z

tests/ls/dired.sh

index 39a59d675ec5a43cbddc0c3fbcf397c859952dcb..c26260f7a3563ca61484c1677368544aec81c2a0 100755 (executable)
@@ -37,7 +37,7 @@ done
 
 # Check with varying positions (due to usernames etc.)
 # Also use multibyte characters to show --dired counts bytes not characters
-touch dir/1a dir/2á || framework_failure_
+touch dir/1a dir/2æ || framework_failure_
 mkdir -p dir/3dir || framework_failure_
 touch dir/aaa || framework_failure_
 ln -s target dir/0aaa_link || framework_failure_
@@ -45,7 +45,7 @@ ln -s target dir/0aaa_link || framework_failure_
 ls -l --dired dir > out || fail=1
 
 dired_values=$(grep "//DIRED//" out| cut -d' ' -f2-)
-expected_files="0aaa_link 1a 2á 3dir aaa"
+expected_files="0aaa_link 1a 2æ 3dir aaa"
 
 dired_count=$(printf '%s\n' $dired_values | wc -l)
 expected_count=$(printf '%s\n' $expected_files | wc -l)