From 79c628901dbff7d4315658187fdff20c4f5e4ade Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?= Date: Tue, 27 Feb 2024 14:05:49 +0000 Subject: [PATCH] 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. --- tests/df/problematic-chars.sh | 3 +-- tests/misc/sleep.sh | 1 - tests/printf/printf-mb.sh | 3 +-- tests/printf/printf-quote.sh | 3 +-- tests/sort/sort-debug-keys.sh | 4 +--- 5 files changed, 4 insertions(+), 10 deletions(-) diff --git a/tests/df/problematic-chars.sh b/tests/df/problematic-chars.sh index 049128e805..a5d5991d08 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 96bd683c2a..2868c2edee 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 80451e8783..1e8802ff03 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 eb718a6299..969e53655f 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 c307da669b..77bc2900e9 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 ( -- 2.47.2