1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-13 19:52:20 +00:00

tests/locale.sh: remove unportable test with external 'wc' command

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)
This commit is contained in:
Martijn Dekker 2020-05-14 18:11:17 +01:00
parent 2318de328a
commit 11226f9edd

View file

@ -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