From: Simon Cozens Date: Fri, 11 Aug 2000 02:24:52 +0000 (+0000) Subject: Tests for #6589. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9b86dfa2dfc420d4b54a13795a56f14045719c64;p=p5sagit%2Fp5-mst-13.2.git Tests for #6589. Subject: Re: B::Deparse was Re: [ID 20000808.005] refs to returned lvalues are lvalues?? Message-ID: p4raw-id: //depot/perl@6597 --- diff --git a/t/lib/b.t b/t/lib/b.t index 96ba126..dba3852 100755 --- a/t/lib/b.t +++ b/t/lib/b.t @@ -10,7 +10,7 @@ use warnings; use strict; use Config; -print "1..10\n"; +print "1..13\n"; my $test = 1; @@ -30,6 +30,28 @@ ok; print "not " if "{\n \$test /= 2 if ++\$test;\n}" ne $deparse->coderef2text(sub {++$test and $test/=2;}); ok; +{ +my $a = <<'EOF'; +{ + $test = sub : lvalue { + 1; + } + ; +} +EOF +chomp $a; +print "not " if $deparse->coderef2text(sub{$test = sub : lvalue { 1 }}) ne $a; +ok; + +$a =~ s/lvalue/method/; +print "not " if $deparse->coderef2text(sub{$test = sub : method { 1 }}) ne $a; +ok; + +$a =~ s/method/locked method/; +print "not " if $deparse->coderef2text(sub{$test = sub : method locked { 1 }}) + ne $a; +ok; +} my $a; my $Is_VMS = $^O eq 'VMS';