diff options
author | Sam Tregar <sam@tregar.com> | 2001-12-30 14:57:55 -0500 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-12-31 04:05:46 +0000 |
commit | 2f758a169336880aced9e22abce6d9196c383e06 (patch) | |
tree | 7a2489ca4726146a64445ca6f5b359f65ee0f535 /t/comp | |
parent | 443a5b981950c0a4ba09217be56a57cb04e64247 (diff) | |
download | perl-2f758a169336880aced9e22abce6d9196c383e06.tar.gz |
Basic bad prototype detection
Message-ID: <Pine.LNX.4.33.0112301948270.9102-200000@localhost.localdomain>
p4raw-id: //depot/perl@13971
Diffstat (limited to 't/comp')
-rwxr-xr-x | t/comp/proto.t | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/t/comp/proto.t b/t/comp/proto.t index a60f36f75b..b42a5cc4c5 100755 --- a/t/comp/proto.t +++ b/t/comp/proto.t @@ -16,7 +16,7 @@ BEGIN { use strict; -print "1..130\n"; +print "1..133\n"; my $i = 1; @@ -527,3 +527,17 @@ print "ok ", $i++, "\n"; print "not " unless myref(*myglob) =~ /^GLOB\(/; print "ok ", $i++, "\n"; } + +# check that obviously bad prototypes are getting rejected +eval 'sub badproto (@bar) { 1; }'; +print "not " unless $@ =~ /^Malformed prototype for main::badproto : \@bar/; +print "ok ", $i++, "\n"; + +eval 'sub badproto2 (bar) { 1; }'; +print "not " unless $@ =~ /^Malformed prototype for main::badproto2 : bar/; +print "ok ", $i++, "\n"; + +eval 'sub badproto3 (&$bar$@) { 1; }'; +print "not " unless $@ =~ /^Malformed prototype for main::badproto3 : &\$bar\$\@/; +print "ok ", $i++, "\n"; + |