This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
run/locale.t: don't setlocale() for our English locale if there isn't one
authorTony Cook <tony@develop-help.com>
Tue, 3 Nov 2020 04:37:33 +0000 (15:37 +1100)
committerTony Cook <tony@develop-help.com>
Tue, 3 Nov 2020 21:42:25 +0000 (08:42 +1100)
This was producing noise on Win32 builds:

Use of uninitialized value in subroutine entry at run/locale.t line 519.

t/run/locale.t

index 8dd2a3a..8a04d1a 100644 (file)
@@ -516,6 +516,8 @@ SKIP:
     use locale;
     # look for an english locale (so a < B, hopefully)
     my ($en) = grep /^en_/, @locales;
+    defined $en
+        or skip "didn't find a suitable locale", 1;
     POSIX::setlocale(LC_COLLATE, $en);
     unless ("a" lt "B") {
         skip "didn't find a suitable locale", 1;