This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
t/re/regexp.t: Silence HP-UX warnings
authorKarl Williamson <khw@cpan.org>
Tue, 27 Feb 2018 20:08:07 +0000 (13:08 -0700)
committerKarl Williamson <khw@cpan.org>
Tue, 27 Feb 2018 20:18:38 +0000 (13:18 -0700)
The tests that use t/re/re_tests may use a locale.  It doesn't much
matter which locale, except we want one that isn't going to generate
warnings.

t/re/regexp.t

index 835cbdc..037d7b7 100644 (file)
@@ -71,6 +71,13 @@ BEGIN {
        print("1..0 # Skip Unicode tables not built yet\n"), exit
            unless eval 'require "unicore/Heavy.pl"';
     }
+
+    # Some of the tests need a locale; which one doesn't much matter, except
+    # that it be valid.  Make sure of that
+    eval { require POSIX;
+            POSIX->import(qw(LC_ALL setlocale));
+            POSIX::setlocale(&LC_ALL, "C");
+    };
 }
 
 sub _comment {