Skip to content

Commit

Permalink
t/loc_tools.pl: Check for unsupported locales
Browse files Browse the repository at this point in the history
This commit causes us not to view unsupported locales as legitimate for
testing.  Core dumps occurred on some platforms without this.

It looks for a diagnostic that the next commit in this series will
generate.
  • Loading branch information
khwilliamson committed May 6, 2021
1 parent 820a0be commit e63ff2f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions t/loc_tools.pl
Expand Up @@ -148,11 +148,13 @@ ($$$$)

my $badutf8 = 0;
my $plays_well = 1;
my $unsupported = 0;

use warnings 'locale';

local $SIG{__WARN__} = sub {
$badutf8 = 1 if grep { /Malformed UTF-8/ } @_;
$unsupported = 1 if grep { /Locale .* is unsupported/i } @_;
$plays_well = 0 if grep {
/Locale .* may not work well(?#
)|The Perl program will use the expected meanings/i
Expand Down Expand Up @@ -187,6 +189,8 @@ ($$$$)
return;
}

return if $unsupported;

# Commas in locale names are bad in Windows, and there is a bug in
# some versions where setlocale() turns a legal input locale name into
# an illegal return value, which it can't later parse.
Expand Down

0 comments on commit e63ff2f

Please sign in to comment.