diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2002-01-05 01:31:12 +0100 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-01-04 22:57:03 +0000 |
commit | 4eba7d22051960c27a75db6011d6e5dcdae952a8 (patch) | |
tree | f5f0d5ff3e20a9f877eb9748851f3c8fa9054125 /t/comp | |
parent | 06a5f41f0431df02a9cd266d1e2a88d3625b083b (diff) | |
download | perl-4eba7d22051960c27a75db6011d6e5dcdae952a8.tar.gz |
Re: [PATCH op.c] Bad \[...] prototype checking
Message-ID: <20020105003112.E1850@rafael>
p4raw-id: //depot/perl@14084
Diffstat (limited to 't/comp')
-rwxr-xr-x | t/comp/proto.t | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/t/comp/proto.t b/t/comp/proto.t index 32b1fad8ee..4141f2abc6 100755 --- a/t/comp/proto.t +++ b/t/comp/proto.t @@ -16,7 +16,7 @@ BEGIN { use strict; -print "1..135\n"; +print "1..140\n"; my $i = 1; @@ -526,6 +526,23 @@ print "ok ", $i++, "\n"; print "ok ", $i++, "\n"; print "not " unless myref(*myglob) =~ /^GLOB\(/; print "ok ", $i++, "\n"; + + eval q/sub multi1 (\[%@]) { 1 } multi1 $myvar;/; + print "not " unless $@ =~ /Type of arg 1 to main::multi1 must be one of/; + print "ok ", $i++, "\n"; + eval q/sub multi2 (\[$*&]) { 1 } multi2 @myarray;/; + print "not " unless $@ =~ /Type of arg 1 to main::multi2 must be one of/; + print "ok ", $i++, "\n"; + eval q/sub multi3 (\[$@]) { 1 } multi3 %myhash;/; + print "not " unless $@ =~ /Type of arg 1 to main::multi3 must be one of/; + print "ok ", $i++, "\n"; + eval q/sub multi4 ($\[%]) { 1 } multi4 1, &mysub;/; + print "not " unless $@ =~ /Type of arg 2 to main::multi4 must be one of/; + print "ok ", $i++, "\n"; + eval q/sub multi5 (\[$@]$) { 1 } multi5 *myglob;/; + print "not " unless $@ =~ /Type of arg 1 to main::multi5 must be one of/ + && $@ =~ /Not enough arguments/; + print "ok ", $i++, "\n"; } # check that obviously bad prototypes are getting warnings |