This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
t: Convert indirect syntax in tests
[perl5.git] / t / re / pat.t
index 71f1141..ff61ed5 100644 (file)
@@ -18,7 +18,7 @@ BEGIN {
     chdir 't' if -d 't';
     require './test.pl';
     set_up_inc('../lib', '.', '../ext/re');
-    require Config; import Config;
+    require Config; Config->import;
     require './charset_tools.pl';
     require './loc_tools.pl';
 }
@@ -26,6 +26,7 @@ BEGIN {
 skip_all_without_unicode_tables();
 
 my $has_locales = locales_enabled('LC_CTYPE');
+my $utf8_locale = find_utf8_ctype_locale();
 
 plan tests => 1265;  # Update this when adding/deleting tests.
 
@@ -1510,11 +1511,10 @@ EOP
         ok("\x{017F}\x{017F}" =~ qr/^[$sharp_s]?$/i, "[] to EXACTish optimization");
     }
 
-    {   # Test that it avoids spllitting a multi-char fold across nodes.
+    {   # Test that it avoids splitting a multi-char fold across nodes.
         # These all fold to things that are like 'ss', which, if split across
         # nodes could fail to match a single character that folds to the
         # combination.  1F0 byte expands when folded;
-        my $utf8_locale = find_utf8_ctype_locale();
         for my $char('F', $sharp_s, "\x{1F0}", "\x{FB00}") {
             my $length = 260;    # Long enough to overflow an EXACTFish regnode
             my $p = $char x $length;
@@ -2315,7 +2315,6 @@ x{0c!}\;\;îçÿ \0\7f/0f/!\0F\ 5\0\0/;îçÿù\Q\0\ 1\0\0x\10ÿÿÿÿ\0\0\0ù\0\0\0\7f`x{0c!}\ 1;\0\0\0ù\Q
 
 SKIP:
     {   # [perl #134334], Assertion failure
-        my $utf8_locale = find_utf8_ctype_locale();
         skip "no UTF-8 locale available" unless $utf8_locale;
         fresh_perl_like("use POSIX; POSIX::setlocale(&LC_CTYPE, '$utf8_locale'); 'ssss' =~ /\xDF+?sX/il;",
                         qr/^$/,