Skip to content

Commit 09b6ecd

Browse files
committed
comp/parser.t count two lines that were being tested to see if they crashed
parser as tests (PASS if the test file is still running after the lines).
1 parent 26e4a9a commit 09b6ecd

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

t/comp/parser.t

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ BEGIN {
88
chdir 't' if -d 't';
99
}
1010

11-
print "1..188\n";
11+
print "1..190\n";
1212

1313
sub failed {
1414
my ($got, $expected, $name) = @_;
@@ -511,19 +511,21 @@ is $@, "Illegal division by zero at maggapom line 2.\n",
511511
512512
# parentheses needed for this to fail an assertion in S_maybe_multideref
513513
is +(${[{a=>214}]}[0])->{a}, 214, '($array[...])->{...}';
514-
514+
{
515515
# This used to fail an assertion because of the OPf_SPECIAL flag on an
516-
# OP_GV that started out as an OP_CONST. No test output is necessary, as
517-
# successful parsing is sufficient.
518-
sub FILE1 () { 1 }
519-
sub dummy { tell FILE1 }
516+
# OP_GV that started out as an OP_CONST.
517+
518+
sub FILE1 () { 1 }
519+
sub dummy { tell FILE1 }
520520
521521
# More potential multideref assertion failures
522522
# OPf_PARENS on OP_RV2SV in subscript
523-
$x[($_)];
523+
$x[($_)];
524+
is(1,1, "PASS: Previous line successfully parsed. OPf_PARENS on OP_RV2SV");
524525
# OPf_SPECIAL on OP_GV in subscript
525-
$x[FILE1->[0]];
526-
526+
$x[FILE1->[0]];
527+
is(1,1, "PASS: Previous line successfully parsed. OPf_SPECIAL on OP_GV");
528+
}
527529
# Used to crash [perl #123542]
528530
eval 's /${<>{}) //';
529531

0 commit comments

Comments
 (0)