This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add warning message for locale/Unicode intermixing
[perl5.git] / t / re / fold_grind.t
index 2f86113..3fb11e5 100644 (file)
@@ -5,9 +5,12 @@ binmode STDOUT, ":utf8";
 BEGIN {
     chdir 't' if -d 't';
     @INC = '../lib';
-    require './test.pl';
+    require './test.pl'; require './charset_tools.pl';
     require Config; import Config;
     skip_all_if_miniperl("no dynamic loading on miniperl, no Encode nor POSIX");
+    if ($^O eq 'dec_osf') {
+      skip_all("$^O cannot handle this test");
+    }
     require './loc_tools.pl';
 }
 
@@ -17,6 +20,7 @@ my $DEBUG = 0;  # Outputs extra information for debugging this .t
 
 use strict;
 use warnings;
+no warnings 'locale';   # Plenty of these would otherwise get generated
 use Encode;
 use POSIX;
 
@@ -423,7 +427,7 @@ my @charsets = qw(d u a aa);
 if($Config{d_setlocale}) {
     my $current_locale = POSIX::setlocale( &POSIX::LC_CTYPE, "C") // "";
     if ($current_locale eq 'C') {
-        require locale; import locale;
+        use locale;
 
         # Some implementations don't have the 128-255 range characters all
         # mean nothing under the C locale (an example being VMS).  This is