Skip to content

Commit

Permalink
t/run/locale.t: debug
Browse files Browse the repository at this point in the history
  • Loading branch information
khwilliamson committed Nov 13, 2023
1 parent e5c4a36 commit 2d5134a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions t/run/locale.t
Expand Up @@ -30,6 +30,7 @@ skip_all("no locales available") unless @locales;
note("locales available: @locales");

my $debug = 0;
#$debug = 1 if $^O eq 'cygwin'; # or $^O eq 'MSWin32';
my $switches = "";
if (defined $ARGV[0] && $ARGV[0] ne "") {
if ($ARGV[0] ne 'debug') {
Expand Down Expand Up @@ -131,11 +132,14 @@ EOF

# try to find out a locale where LC_NUMERIC makes a difference
my $original_locale = setlocale(LC_NUMERIC);
print STDERR __FILE__, ": ", __LINE__, ": $original_locale\n" if $debug;

my ($base, $different, $comma, $difference, $utf8_radix);
my $radix_encoded_as_utf8;
$^D = 0x04000000|0x00100000 if $debug;
for ("C", @locales) { # prefer C for the base if available
use locale;
print STDERR __FILE__, ": ", __LINE__, ": $_\n" if $debug;
setlocale(LC_NUMERIC, $_) or next;
my $in = 4.2; # avoid any constant folding bugs
if ((my $s = sprintf("%g", $in)) eq "4.2") {
Expand All @@ -162,6 +166,7 @@ EOF
last if $base && $different && $comma && $utf8_radix;
}
setlocale(LC_NUMERIC, $original_locale);
$^D = 0 if $debug;

SKIP: {
skip("no UTF-8 locale available where LC_NUMERIC radix isn't ASCII", 1 )
Expand Down

0 comments on commit 2d5134a

Please sign in to comment.