From: Michael G. Schwern Date: Tue, 9 Apr 2002 20:52:55 +0000 (-0400) Subject: Re: another patch (unready) against t/op/sub_lval.t X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1c4274f4e1188e020081389d72b980ad3f5981f2;p=p5sagit%2Fp5-mst-13.2.git Re: another patch (unready) against t/op/sub_lval.t Message-ID: <20020410005254.GI8954@blackrider> p4raw-id: //depot/perl@15837 --- diff --git a/t/op/sub_lval.t b/t/op/sub_lval.t index ca33dfe..308269e 100755 --- a/t/op/sub_lval.t +++ b/t/op/sub_lval.t @@ -1,4 +1,4 @@ -print "1..64\n"; +print "1..67\n"; BEGIN { chdir 't' if -d 't'; @@ -532,3 +532,34 @@ sub lval2 : lvalue { $ary[1]; } (lval1(), lval2()) = split ' ', "1 2 3 4"; print "not " unless join(':', @ary) eq "1:2:6"; print "ok 64\n"; + +require './test.pl'; +curr_test(65); + +TODO: { + local $TODO = 'test explicit return of lval expr'; + + # subs are corrupted copies from tests 1-~4 + sub bad_get_lex : lvalue { return $in }; + sub bad_get_st : lvalue { return $blah } + + sub bad_id : lvalue { return ${\shift} } + sub bad_id1 : lvalue { return $_[0] } + sub bad_inc : lvalue { return ${\++$_[0]} } + + $in = 5; + $blah = 3; + + bad_get_st = 7; + + is( $blah, 7 ); + + bad_get_lex = 7; + + is($in, 7, "yada"); + + ++bad_get_st; + + is($blah, 8, "yada"); +} +