From 11226f9edd5daa5474831c4307ff62fafa75a044 Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Thu, 14 May 2020 18:11:17 +0100 Subject: [PATCH] tests/locale.sh: remove unportable test with external 'wc' command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The -C flag to 'wc' is not portable; '-m' is the portable variant. However, this whole test is not appropriate here, as it tests the external 'wc' utility and not ksh's builtin version -- so any test failure represents a bug in the OS and not in ksh. src/cmd/ksh93/tests/locale.sh: - Remove test that counts two € (euro) character using the OS's external 'wc' utility. Keep the test that uses builtin 'wc'. (cherry picked from commit e1b25e0ace85ee6e62734fb236900fe069dccb6e) --- src/cmd/ksh93/tests/locale.sh | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/cmd/ksh93/tests/locale.sh b/src/cmd/ksh93/tests/locale.sh index 1eeab1346..9b38159af 100755 --- a/src/cmd/ksh93/tests/locale.sh +++ b/src/cmd/ksh93/tests/locale.sh @@ -113,18 +113,6 @@ fi #$SHELL -c 'export LANG='$locale'; printf "\u[20ac]\u[20ac]" > $tmp/two_euro_chars.txt' printf $'\342\202\254\342\202\254' > $tmp/two_euro_chars.txt exp="6 2 6" -set -- $($SHELL -c " - unset LC_CTYPE - export LANG=$locale - export LC_ALL=C - command wc -C < $tmp/two_euro_chars.txt - unset LC_ALL - command wc -C < $tmp/two_euro_chars.txt - export LC_ALL=C - command wc -C < $tmp/two_euro_chars.txt -") -got=$* -[[ $got == $exp ]] || err_exit "command wc LC_ALL default failed -- expected '$exp', got '$got'" set -- $($SHELL -c " if builtin wc 2>/dev/null || builtin -f cmd wc 2>/dev/null then unset LC_CTYPE