diff options
author | Niko Tyni <ntyni@debian.org> | 2010-10-27 10:56:24 +0300 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-10-27 05:52:22 -0700 |
commit | b3fd61496ebc585b1115807e3195f17714662a09 (patch) | |
tree | 3466930c913145aebb2da4ef7fe12a0152be71eb /t/run | |
parent | 903eb63f7d8d47a38971a8e9af7201b9927882cf (diff) | |
download | perl-b3fd61496ebc585b1115807e3195f17714662a09.tar.gz |
Don't fold constants in sprintf() if locales are used
Commit c427f4d2d4575fbc8a5190932fe321136c7597b3 in 5.10.1 made sprintf()
ignore LC_NUMERIC for numeric constants.
Diffstat (limited to 't/run')
-rw-r--r-- | t/run/locale.t | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/t/run/locale.t b/t/run/locale.t index 483123f16b..2f7306b521 100644 --- a/t/run/locale.t +++ b/t/run/locale.t @@ -128,6 +128,19 @@ EOF "too late to ignore the locale at write() time"); } } + + for ($different) { + local $ENV{LC_NUMERIC} = $_; + local $ENV{LC_ALL}; # so it never overrides LC_NUMERIC + fresh_perl_is(<<'EOF', "$difference "x4, {}, + use locale; + use POSIX qw(locale_h); + setlocale(LC_NUMERIC, ""); + my $in = 4.2; + printf("%g %g %s %s ", $in, 4.2, sprintf("%g", $in), sprintf("%g", 4.2)); +EOF + "sprintf() and printf() look at LC_NUMERIC regardless of constant folding"); + } } # SKIP -sub last { 6 } +sub last { 7 } |