diff options
author | Karl Williamson <khw@cpan.org> | 2014-06-17 13:10:04 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2014-06-17 20:21:39 -0600 |
commit | 5af2752aabf6731775c287b133439247cf874196 (patch) | |
tree | 8364da0b1714e15fa43e0abddcc488258d6e9c8c | |
parent | 6a78954a430771d49e5e9a927c63670d03f6e1dc (diff) | |
download | perl-5af2752aabf6731775c287b133439247cf874196.tar.gz |
lib/locale.t: Skip testing $! unless LC_MESSAGES exists
Some platforms don't have LC_MESSAGES for some or all locales, so skip
these tests on them.
-rw-r--r-- | lib/locale.t | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/locale.t b/lib/locale.t index 13fc5741c0..7c97db04cd 100644 --- a/lib/locale.t +++ b/lib/locale.t @@ -1842,9 +1842,10 @@ foreach my $Locale (@Locale) { # Look for non-ASCII error messages, and verify that the first # such is in UTF-8 (the others almost certainly will be like the - # first). + # first). This is only done if the current locale has LC_MESSAGES $ok14 = 1; $ok14_5 = 1; + if (setlocale(&POSIX::LC_MESSAGES, $Locale)) { foreach my $err (keys %!) { use Errno; $! = eval "&Errno::$err"; # Convert to strerror() output @@ -1856,6 +1857,7 @@ foreach my $Locale (@Locale) { last; } } + } # Similarly, we verify that a non-ASCII radix is in UTF-8. This # also catches if there is a disparity between sprintf and |