diff options
author | Rafael Garcia-Suarez <rgs@consttype.org> | 2009-10-28 10:44:31 +0100 |
---|---|---|
committer | Rafael Garcia-Suarez <rgs@consttype.org> | 2009-10-28 10:44:31 +0100 |
commit | 28c5b5bcd7f52e6b2219508a1066cd0ccc8dd19a (patch) | |
tree | 47b207d9b199dfb965aefa23fa423b49e213788b /t | |
parent | 02d85cc37a4acecafdc2f0b45640b03cd1f4ac71 (diff) | |
download | perl-28c5b5bcd7f52e6b2219508a1066cd0ccc8dd19a.tar.gz |
$#array should be accepted as a lvalue sub return value.
The OPpMAYBE_LVSUB flag wasn't set for OP_AV2ARYLEN, but the
new implementation of pp_av2arylen introduced by the previous
patch was relying on it. So, now, set this flag. Also add tests for
STORESIZE.
Diffstat (limited to 't')
-rw-r--r-- | t/op/tiearray.t | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/t/op/tiearray.t b/t/op/tiearray.t index 5ef6bfbdd4..ca8a3c3f1f 100644 --- a/t/op/tiearray.t +++ b/t/op/tiearray.t @@ -147,7 +147,7 @@ sub FETCHSIZE { -1 } package main; -print "1..62\n"; +print "1..66\n"; my $test = 1; {my @ary; @@ -234,7 +234,6 @@ print "ok ", $test++,"\n"; print "not " unless join(':',@ary) eq '1:2:3'; print "ok ", $test++,"\n"; - my $t = 0; foreach $n (@ary) { @@ -265,6 +264,19 @@ print "ok ", $test++,"\n"; print "not " unless join(':',@ary) eq '3:2:1'; print "ok ", $test++,"\n"; +$#ary = 1; +print "not " unless $seen{'STORESIZE'} == 1; +print "ok ", $test++," -- seen STORESIZE\n"; +print "not " unless join(':',@ary) eq '3:2'; +print "ok ", $test++,"\n"; + +sub arysize :lvalue { $#ary } +arysize()--; +print "not " unless $seen{'STORESIZE'} == 2; +print "ok ", $test++," -- seen STORESIZE\n"; +print "not " unless join(':',@ary) eq '3'; +print "ok ", $test++,"\n"; + untie @ary; } |