Skip to content

Commit

Permalink
More regression tests for perl #58608 (quoting / in qr//).
Browse files Browse the repository at this point in the history
These somewhat duplicate the tests in t/qr.t. It's not clear if that file is
actually redundant now, or whether it tests some failure modes that this
file's &TEST setup can't.
  • Loading branch information
nwc10 committed May 14, 2021
1 parent 69615fb commit 13b732e
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion dist/Data-Dumper/t/dumper.t
Expand Up @@ -139,7 +139,7 @@ sub SKIP_TEST {
++$TNUM; print "ok $TNUM # skip $reason\n";
}

$TMAX = 474;
$TMAX = 480;

# Force Data::Dumper::Dump to use perl. We test Dumpxs explicitly by calling
# it direct. Out here it lets us knobble the next if to test that the perl
Expand Down Expand Up @@ -1733,6 +1733,32 @@ EOW
if $XS;
}
#############
{
# [more perl #58608 tests]
my $bs = "\\\\";
$WANT = <<"EOW";
#\$VAR1 = [
# qr/ \\/ /,
# qr/ \\?\\/ /,
# qr/ $bs\\/ /,
# qr/ $bs:\\/ /,
# qr/ \\?$bs:\\/ /,
# qr/ $bs$bs\\/ /,
# qr/ $bs$bs:\\/ /,
# qr/ $bs$bs$bs\\/ /
#];
EOW
if ($] lt '5.010001') {
$WANT =~ s!qr/!qr/(?-xism:!g;
$WANT =~ s! /! )/!g;
}
TEST qq(Data::Dumper->Dump([ [qr! / !, qr! \\?/ !, qr! $bs/ !, qr! $bs:/ !, qr! \\?$bs:/ !, qr! $bs$bs/ !, qr! $bs$bs:/ !, qr! $bs$bs$bs/ !, ] ])),
"more perl #58608";
TEST qq(Data::Dumper->Dump([ [qr! / !, qr! \\?/ !, qr! $bs/ !, qr! $bs:/ !, qr! \\?$bs:/ !, qr! $bs$bs/ !, qr! $bs$bs:/ !, qr! $bs$bs$bs/ !, ] ])),
"more perl #58608 XS"
if $XS;
}
#############
{
# [perl #82948]
# re::regexp_pattern was moved to universal.c in v5.10.0-252-g192c1e2
Expand Down

0 comments on commit 13b732e

Please sign in to comment.