From e6982e4df6e7e37b11fe6b0fff4b54f72e10151c Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Sat, 4 Mar 2023 07:05:44 -0700 Subject: [PATCH] XXX run/locale.t: maybe f move test --- t/run/locale.t | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/t/run/locale.t b/t/run/locale.t index 5c4a5f5055b8..3ac333f419c0 100644 --- a/t/run/locale.t +++ b/t/run/locale.t @@ -173,6 +173,23 @@ EOF SKIP: { skip("no locale available where LC_NUMERIC radix isn't '.'", 30) unless $different; note("using the '$different' locale for LC_NUMERIC tests"); + SKIP: { + unless ($have_localeconv) { + skip("no localeconv()", 1); + } + else { + local $ENV{LC_NUMERIC} = $different; + fresh_perl_is(<<'EOF', ",,", { eval $switches }, + use POSIX; + no warnings "utf8"; + print localeconv()->{decimal_point}; + use locale; + print localeconv()->{decimal_point}; +EOF + "localeconv() looks at LC_NUMERIC with and without 'use locale'"); + } + } + SKIP: { { local $ENV{LC_NUMERIC} = $different; @@ -198,21 +215,6 @@ EOF "format() looks at LC_NUMERIC with 'use locale'"); } - SKIP: { - unless ($have_localeconv) { - skip("no localeconv()", 1); - } - else { - fresh_perl_is(<<'EOF', ",,", { eval $switches }, - use POSIX; - no warnings "utf8"; - print localeconv()->{decimal_point}; - use locale; - print localeconv()->{decimal_point}; -EOF - "localeconv() looks at LC_NUMERIC with and without 'use locale'"); - } - } { my $categories = ":collate :characters :collate :ctype :monetary :time"; @@ -289,6 +291,7 @@ EOF "too late to ignore the locale at write() time"); } } + } { # do not let "use 5.000" affect the locale!