From: Pádraig Brady
Date: Sun, 24 Nov 2024 12:51:43 +0000 (+0000) Subject: tests: avoid false failure with unicode decomposed file systems X-Git-Tag: v9.6~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb2774501d7a292900a8a547d6c7cdc62f90c7fb;p=thirdparty%2Fcoreutils.git tests: avoid false failure with unicode decomposed file systems * 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 --- diff --git a/tests/ls/dired.sh b/tests/ls/dired.sh index 39a59d675e..c26260f7a3 100755 --- a/tests/ls/dired.sh +++ b/tests/ls/dired.sh @@ -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)