summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2024-02-27 14:05:49 +0000
committerPádraig Brady <P@draigBrady.com>2024-02-27 14:27:04 +0000
commit79c628901dbff7d4315658187fdff20c4f5e4ade (patch)
tree17f575fd2e7fd5ab83eb4b9ad45c4b36c8f48a26
parentjoin: avoid test failure on systems with no French UTF-8 locale (diff)
downloadcoreutils-79c628901dbff7d4315658187fdff20c4f5e4ade.tar.gz
coreutils-79c628901dbff7d4315658187fdff20c4f5e4ade.zip
tests: simplify treatment of the $LOCALE_FR_UTF8 variable
* tests/df/problematic-chars.sh: Rely on gnulib setting this to "none" where not usable. * tests/misc/sleep.sh: Likewise. * tests/printf/printf-mb.sh: Likewise. * tests/printf/printf-quote.sh: Likewise. * tests/sort/sort-debug-keys.sh: Likewise.
-rwxr-xr-xtests/df/problematic-chars.sh3
-rwxr-xr-xtests/misc/sleep.sh1
-rwxr-xr-xtests/printf/printf-mb.sh3
-rwxr-xr-xtests/printf/printf-quote.sh3
-rwxr-xr-xtests/sort/sort-debug-keys.sh4
5 files changed, 4 insertions, 10 deletions
diff --git a/tests/df/problematic-chars.sh b/tests/df/problematic-chars.sh
index 049128e80..a5d5991d0 100755
--- a/tests/df/problematic-chars.sh
+++ b/tests/df/problematic-chars.sh
@@ -46,9 +46,8 @@ test "$fail" = 1 && dump_mount_list_
# Ensure mount points not matching the current user encoding are output
unset LC_ALL
-f=$LOCALE_FR_UTF8
-: ${LOCALE_FR_UTF8=none}
if test "$LOCALE_FR_UTF8" != "none"; then
+ f=$LOCALE_FR_UTF8
cleanup_ || framework_failure_
diff --git a/tests/misc/sleep.sh b/tests/misc/sleep.sh
index 96bd683c2..2868c2ede 100755
--- a/tests/misc/sleep.sh
+++ b/tests/misc/sleep.sh
@@ -40,7 +40,6 @@ returns_ 124 timeout 0.1 sleep inf || fail=1
returns_ 124 timeout 0.1 sleep $LDBL_MAX || fail=1
# Test locale decimal handling for printf, sleep, timeout
-: ${LOCALE_FR_UTF8=none}
if test "$LOCALE_FR_UTF8" != "none"; then
f=$LOCALE_FR_UTF8
locale_decimal=$(LC_ALL=$f env printf '%0.3f' 0.001) || fail=1
diff --git a/tests/printf/printf-mb.sh b/tests/printf/printf-mb.sh
index 80451e878..1e8802ff0 100755
--- a/tests/printf/printf-mb.sh
+++ b/tests/printf/printf-mb.sh
@@ -22,9 +22,8 @@ print_ver_ printf
prog='env printf'
unset LC_ALL
-f=$LOCALE_FR_UTF8
-: ${LOCALE_FR_UTF8=none}
if test "$LOCALE_FR_UTF8" != "none"; then
+ f=$LOCALE_FR_UTF8
(
#valid multi-byte
LC_ALL=$f $prog '%04x\n' '"á' >>out 2>>err
diff --git a/tests/printf/printf-quote.sh b/tests/printf/printf-quote.sh
index eb718a629..969e53655 100755
--- a/tests/printf/printf-quote.sh
+++ b/tests/printf/printf-quote.sh
@@ -35,9 +35,8 @@ EOF
compare exp out || fail=1
unset LC_ALL
-f=$LOCALE_FR_UTF8
-: ${LOCALE_FR_UTF8=none}
if test "$LOCALE_FR_UTF8" != "none"; then
+ f=$LOCALE_FR_UTF8
(
#printable multi-byte
LC_ALL=$f $prog '%q\n' 'áḃç' > out
diff --git a/tests/sort/sort-debug-keys.sh b/tests/sort/sort-debug-keys.sh
index c307da669..77bc2900e 100755
--- a/tests/sort/sort-debug-keys.sh
+++ b/tests/sort/sort-debug-keys.sh
@@ -316,10 +316,8 @@ ___________________
EOF
unset LC_ALL
-f=$LOCALE_FR_UTF8
-
-: ${LOCALE_FR_UTF8=none}
if test "$LOCALE_FR_UTF8" != "none"; then
+ f=$LOCALE_FR_UTF8
LC_NUMERIC=$f LC_MESSAGES=C sort -g --debug /dev/null 2> debug.out
if grep 'numbers use .*,.* as a decimal point' debug.out >/dev/null; then
(