From cb2774501d7a292900a8a547d6c7cdc62f90c7fb Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?= Date: Sun, 24 Nov 2024 12:51:43 +0000 Subject: [PATCH] tests: avoid false failure with unicode decomposed file systems MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) -- 2.47.3