# Checks if the parser behaves correctly in edge cases
# (including weird syntax errors)
-print "1..117\n";
+print "1..118\n";
sub failed {
my ($got, $expected, $name) = @_;
like($@, qr/Identifier too long/, "too long id ticket case");
}
+{
+ eval qq[ {sub zlonk} ];
+ is($@, '', 'sub declaration followed by a closing curly');
+}
+
# Add new tests HERE:
# More awkward tests for #line. Keep these at the end, as they will screw
else if (*s != '{' && key == KEY_sub) {
if (!have_name)
Perl_croak(aTHX_ "Illegal declaration of anonymous subroutine");
- else if (*s != ';')
+ else if (*s != ';' && *s != '}')
Perl_croak(aTHX_ "Illegal declaration of subroutine %"SVf, SVfARG(PL_subname));
}