From: Nicholas Clark Date: Mon, 4 Jan 2010 11:23:55 +0000 (+0000) Subject: Following fd909433c7437296, check that {sub f} correctly stubs the subroutine. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c9e0c59bcb20d0c489480be8a6af98bbb64c28d2;p=p5sagit%2Fp5-mst-13.2.git Following fd909433c7437296, check that {sub f} correctly stubs the subroutine. --- diff --git a/t/comp/parser.t b/t/comp/parser.t index 65315bc..16d7b82 100644 --- a/t/comp/parser.t +++ b/t/comp/parser.t @@ -3,7 +3,7 @@ # Checks if the parser behaves correctly in edge cases # (including weird syntax errors) -print "1..118\n"; +print "1..121\n"; sub failed { my ($got, $expected, $name) = @_; @@ -334,8 +334,11 @@ like($@, qr/BEGIN failed--compilation aborted/, 'BEGIN 7' ); } { + is(exists &zlonk, '', 'sub not present'); eval qq[ {sub zlonk} ]; is($@, '', 'sub declaration followed by a closing curly'); + is(exists &zlonk, 1, 'sub now stubbed'); + is(defined &zlonk, '', 'but no body defined'); } # Add new tests HERE: