diff options
author | Karl Williamson <khw@cpan.org> | 2021-04-12 05:13:25 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2022-08-18 09:04:15 -0600 |
commit | 74ecb5a150c08c23c0219dcaf8c55af7ba696bd5 (patch) | |
tree | ec47394499252be6264a4b305c0bb3ff1f65a751 /t/loc_tools.pl | |
parent | 7e82ae0e822b54d0bbf67ec6df9268e1eb4ee499 (diff) | |
download | perl-74ecb5a150c08c23c0219dcaf8c55af7ba696bd5.tar.gz |
t/loc_tools.pl: Check for unsupported locales
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.
Diffstat (limited to 't/loc_tools.pl')
-rw-r--r-- | t/loc_tools.pl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/t/loc_tools.pl b/t/loc_tools.pl index 100e7973e0..f7880a0f04 100644 --- a/t/loc_tools.pl +++ b/t/loc_tools.pl @@ -161,11 +161,13 @@ sub _trylocale ($$$$) { # For use only by other functions in this file! 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 @@ -200,6 +202,8 @@ sub _trylocale ($$$$) { # For use only by other functions in this file! 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. |