From 49c7a52edd5cab5a2f08e3eecb1f23a9cb44f23d Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Thu, 14 May 2020 18:25:20 +0100 Subject: [PATCH] tests/locale.sh: fix UTF-8 test to use builtin command This test used an unportable invocation of an external 'join' command. The options used were Solaris-specific. Not all OSs support UTF-8 in their external utilities so using an external utility is not appropriate. src/cmd/ksh93/tests/locale.sh: - Rewrite the 'join test script' to use ksh builtin 'cut' instead. This should suffice to check whether the locale is correctly set, which is the point of this test. (cherry picked from commit fb16f33ff1e9d33d5fccc5cf9633d508eb6eecc7) --- src/cmd/ksh93/tests/locale.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/cmd/ksh93/tests/locale.sh b/src/cmd/ksh93/tests/locale.sh index 9b38159af..262fae7dc 100755 --- a/src/cmd/ksh93/tests/locale.sh +++ b/src/cmd/ksh93/tests/locale.sh @@ -189,10 +189,11 @@ printf 'f1\357\274\240f2\n' > input1 printf 't2\357\274\240f1\n' > input2 printf '\357\274\240\n' > delim print "export LC_ALL=$locale -join -j1 1 -j2 2 -o 1.1 -t \$(cat delim) input1 input2 > out" > script +builtin cut || exit +cut -f 1 -d \$(cat delim) input1 input2 > out" > script $SHELL -c 'unset LANG ${!LC_*}; $SHELL ./script' || -err_exit "join test script failed -- exit code $?" -exp="f1" +err_exit "'cut' builtin failed -- exit code $?" +exp=$'f1\nt2' got="$(