diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-07-17 19:12:33 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-07-17 19:12:33 +0000 |
commit | 1c01eb51ee8cc1e95e1f674a8ad0766f5498744b (patch) | |
tree | f330a0ae56dd4c011f35b335c08a05fae2ac3bc9 /t | |
parent | 7bb043c358def186b952b465c24a2249d64f519e (diff) | |
download | perl-1c01eb51ee8cc1e95e1f674a8ad0766f5498744b.tar.gz |
allow $foo{$x} and $bar[$i] for (\$) prototype
p4raw-id: //depot/perl@3681
Diffstat (limited to 't')
-rwxr-xr-x | t/comp/proto.t | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/t/comp/proto.t b/t/comp/proto.t index 6d60342b5f..ecfbec60da 100755 --- a/t/comp/proto.t +++ b/t/comp/proto.t @@ -16,7 +16,7 @@ BEGIN { use strict; -print "1..100\n"; +print "1..107\n"; my $i = 1; @@ -448,11 +448,21 @@ star2 $star, $star, sub { print "ok $i\n" star2($star, $star, sub { print "ok $i\n" if $_[0] eq 'FOO' and $_[1] eq 'FOO' }); $i++; star2 *FOO, *BAR, sub { print "ok $i\n" - if $_[0] eq \*FOO and $_[0] eq \*BAR }; $i++; + if $_[0] eq \*FOO and $_[1] eq \*BAR }; $i++; star2(*FOO, *BAR, sub { print "ok $i\n" - if $_[0] eq \*FOO and $_[0] eq \*BAR }); $i++; + if $_[0] eq \*FOO and $_[1] eq \*BAR }); $i++; star2 \*FOO, \*BAR, sub { no strict 'refs'; print "ok $i\n" - if $_[0] eq \*{'FOO'} and $_[0] eq \*{'BAR'} }; $i++; + if $_[0] eq \*{'FOO'} and $_[1] eq \*{'BAR'} }; $i++; star2(\*FOO, \*BAR, sub { no strict 'refs'; print "ok $i\n" - if $_[0] eq \*{'FOO'} and $_[0] eq \*{'BAR'} }); $i++; + if $_[0] eq \*{'FOO'} and $_[1] eq \*{'BAR'} }); $i++; +# test scalarref prototype +sub sreftest (\$$) { + print "ok $_[1]\n" if ref $_[0]; +} +{ + no strict 'vars'; + sreftest my $sref, $i++; + sreftest($helem{$i}, $i++); + sreftest $aelem[0], $i++; +} |