summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-02-25 15:56:04 +0000
committerNicholas Clark <nick@ccl4.org>2011-03-06 09:13:50 +0000
commit5c0a530f531c4c1d760edf76bbc9ed69672e15e2 (patch)
treeffad4de6cbc170b2df4773b31ca2fd7f94ebb011 /t
parent4fd7f5ff8da050d88e61e334c715394bb9403e9e (diff)
downloadperl-5c0a530f531c4c1d760edf76bbc9ed69672e15e2.tar.gz
Move two tests using charnames from t/re/pat.t to pat_rt_report.t
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.
Diffstat (limited to 't')
-rw-r--r--t/re/pat.t24
-rw-r--r--t/re/pat_rt_report.t25
2 files changed, 25 insertions, 24 deletions
diff --git a/t/re/pat.t b/t/re/pat.t
index e453327b04..3b170c8b81 100644
--- a/t/re/pat.t
+++ b/t/re/pat.t
@@ -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.
diff --git a/t/re/pat_rt_report.t b/t/re/pat_rt_report.t
index ea4e6bc566..c0a0ec70e0 100644
--- a/t/re/pat_rt_report.t
+++ b/t/re/pat_rt_report.t
@@ -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;