do "re/ReTest.pl" or die $@;
}
-plan tests => 433; # Update this when adding/deleting tests.
+plan tests => 436; # Update this when adding/deleting tests.
run_tests() unless caller;
# next three tests will fail if you should have picked up a lower-than-
# default value for $reg_infty from Config.pm, but have not.
- eval_ok q (('aaa' =~ /(a{1,$::reg_infty_m})/)[0] eq 'aaa'), $message;
- eval_ok q (('a' x $::reg_infty_m) =~ /a{$::reg_infty_m}/), $message;
- eval_ok q (('a' x ($::reg_infty_m - 1)) !~ /a{$::reg_infty_m}/), $message;
+ is(eval q{('aaa' =~ /(a{1,$::reg_infty_m})/)[0]}, 'aaa', $message);
+ is($@, '', $message);
+ is(eval q{('a' x $::reg_infty_m) =~ /a{$::reg_infty_m}/}, 1, $message);
+ is($@, '', $message);
+ isnt(q{('a' x ($::reg_infty_m - 1)) !~ /a{$::reg_infty_m}/}, 1, $message);
+ is($@, '', $message);
+
eval "'aaa' =~ /a{1,$::reg_infty}/";
like($@, /^\QQuantifier in {,} bigger than/, $message);
eval "'aaa' =~ /a{1,$::reg_infty_p}/";
{
my $message = "/x tests";
$_ = "foo";
- eval_ok(<<" --", $message);
+ foreach my $pat (<<" --", <<" --") {
/f
o\r
o
\$
/x
--
- eval_ok(<<" --", $message);
/f
o
o
\$\r
/x
--
+ is(eval $pat, 1, $message);
+ is($@, '', $message);
+ }
}
{
my $message = q [Don't misparse \x{...} in regexp ] .
q [near 127 char EXACT limit];
for my $tail ('\x{0061}', '\x{1234}', '\x61') {
- eval_ok qq ["$head$tail" =~ /$head$tail/], $message;
+ eval qq{like("$head$tail", qr/$head$tail/, \$message)};
+ is($@, '', $message);
}
$message = q [Don't misparse \N{...} in regexp ] .
q [near 127 char EXACT limit];
for my $tail ('\N{SNOWFLAKE}') {
- eval_ok qq [use charnames ':full';
- "$head$tail" =~ /$head$tail/], $message;
+ eval qq {use charnames ':full';
+ like("$head$tail", qr/$head$tail/, \$message)};
+ is($@, '', $message);
}
}
}
{ # Bleadperl v5.13.8-292-gf56b639 breaks NEZUMI/Unicode-LineBreak-1.011
# \xdf in lookbehind failed to compile as is multi-char fold
- eval_ok 'qr{
+ my $message = "Lookbehind with \\xdf matchable compiles";
+ my $r = eval 'qr{
(?u: (?<=^url:) |
(?<=[/]) (?=[^/]) |
(?<=[^-.]) (?=[-~.,_?\#%=&]) |
(?<=[=&]) (?=.)
- )}iox', "Lookbehind with \\xdf matchable compiles";
+ )}iox';
+ is($@, '', $message);
+ isa_ok($r, 'Regexp', $message);
}
# RT #82610