Move two tests using charnames from t/re/pat.t to pat_rt_report.t
authorNicholas Clark <nick@ccl4.org>
Fri, 25 Feb 2011 15:56:04 +0000 (15:56 +0000)
committerNicholas Clark <nick@ccl4.org>
Sun, 6 Mar 2011 09:13:50 +0000 (09:13 +0000)
The latter is skipped under minitest, as C<re> may not be available.
charnames may also fail to load under minitest, if File::Spec has not been
built. t/re/pat.t should now always run (and pass) under minitest.

t/re/pat.t
t/re/pat_rt_report.t

index e453327..3b170c8 100644 (file)
@@ -21,7 +21,7 @@ BEGIN {
     require './test.pl';
 }
 
-plan tests => 455;  # Update this when adding/deleting tests.
+plan tests => 449;  # Update this when adding/deleting tests.
 
 run_tests() unless caller;
 
@@ -992,28 +992,6 @@ sub run_tests {
     }
 
     {
-        use charnames ":full";
-        # Delayed interpolation of \N'
-        my $r1 = qr/\N{THAI CHARACTER SARA I}/;
-        my $s1 = "\x{E34}\x{E34}\x{E34}\x{E34}";
-
-        # Bug #56444
-        ok $s1 =~ /$r1+/, 'my $r1 = qr/\N{THAI CHARACTER SARA I}/; my $s1 = "\x{E34}\x{E34}\x{E34}\x{E34}; $s1 =~ /$r1+/';
-
-        # Bug #62056
-        ok "${s1}A" =~ m/$s1\N{LATIN CAPITAL LETTER A}/, '"${s1}A" =~ m/$s1\N{LATIN CAPITAL LETTER A}/';
-
-        ok "abbbbc" =~ m/\N{1}/ && $& eq "a", '"abbbbc" =~ m/\N{1}/ && $& eq "a"';
-        ok "abbbbc" =~ m/\N{3,4}/ && $& eq "abbb", '"abbbbc" =~ m/\N{3,4}/ && $& eq "abbb"';
-    }
-
-    {
-        use charnames ":full";
-        my $message = '[perl #74982] Period coming after \N{}';
-        ok("\x{ff08}." =~ m/\N{FULLWIDTH LEFT PARENTHESIS}./ && $& eq "\x{ff08}.", $message);
-        ok("\x{ff08}." =~ m/[\N{FULLWIDTH LEFT PARENTHESIS}]./ && $& eq "\x{ff08}.", $message);
-    }
-    {
         my $n= 50;
         # this must be a high number and go from 0 to N, as the bug we are looking for doesn't
         # seem to be predictable. Slight changes to the test make it fail earlier or later.
index ea4e6bc..c0a0ec7 100644 (file)
@@ -22,7 +22,7 @@ BEGIN {
 }
 
 
-plan tests => 2514;  # Update this when adding/deleting tests.
+plan tests => 2520;  # Update this when adding/deleting tests.
 
 run_tests() unless caller;
 
@@ -1098,6 +1098,29 @@ sub run_tests {
           'stclass optimisation does not break + inside (?=); Bug 68564');
     }
 
+    {
+        use charnames ":full";
+        # Delayed interpolation of \N'
+        my $r1 = qr/\N{THAI CHARACTER SARA I}/;
+        my $s1 = "\x{E34}\x{E34}\x{E34}\x{E34}";
+
+        # Bug #56444
+        ok $s1 =~ /$r1+/, 'my $r1 = qr/\N{THAI CHARACTER SARA I}/; my $s1 = "\x{E34}\x{E34}\x{E34}\x{E34}; $s1 =~ /$r1+/';
+
+        # Bug #62056
+        ok "${s1}A" =~ m/$s1\N{LATIN CAPITAL LETTER A}/, '"${s1}A" =~ m/$s1\N{LATIN CAPITAL LETTER A}/';
+
+        ok "abbbbc" =~ m/\N{1}/ && $& eq "a", '"abbbbc" =~ m/\N{1}/ && $& eq "a"';
+        ok "abbbbc" =~ m/\N{3,4}/ && $& eq "abbb", '"abbbbc" =~ m/\N{3,4}/ && $& eq "abbb"';
+    }
+
+    {
+        use charnames ":full";
+        my $message = '[perl #74982] Period coming after \N{}';
+        ok("\x{ff08}." =~ m/\N{FULLWIDTH LEFT PARENTHESIS}./ && $& eq "\x{ff08}.", $message);
+        ok("\x{ff08}." =~ m/[\N{FULLWIDTH LEFT PARENTHESIS}]./ && $& eq "\x{ff08}.", $message);
+    }
+
 } # End of sub run_tests
 
 1;