From: Rafael Garcia-Suarez Date: Tue, 6 Oct 2009 21:01:35 +0000 (+0200) Subject: Add tests for syntax errors in "package Name VERSION" X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=87c2a47ff8f4b131d303f7c8afda0cbd6c321837;p=p5sagit%2Fp5-mst-13.2.git Add tests for syntax errors in "package Name VERSION" --- diff --git a/t/comp/package.t b/t/comp/package.t index fb07f13..85fd1a5 100644 --- a/t/comp/package.t +++ b/t/comp/package.t @@ -1,6 +1,6 @@ #!./perl -print "1..18\n"; +print "1..22\n"; $blurfl = 123; $foo = 3; @@ -89,4 +89,18 @@ for my $v ( @variations ) { $test_count++; } +eval q/package Foo Bar/; +$@ =~ /syntax error/ or print "not "; +print "ok $test_count\n"; $test_count++; +eval q/package Foo 1a/; +$@ =~ /syntax error/ or print "not "; +print "ok $test_count\n"; $test_count++; + +eval q/package Foo v/; +$@ =~ /syntax error/ or print "not "; +print "ok $test_count\n"; $test_count++; + +eval q/package Foo $foo/; +$@ =~ /syntax error/ or print "not "; +print "ok $test_count\n"; $test_count++;