This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Tests for #6589.
authorSimon Cozens <simon@netthink.co.uk>
Fri, 11 Aug 2000 02:24:52 +0000 (02:24 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Fri, 11 Aug 2000 02:39:04 +0000 (02:39 +0000)
Subject: Re: B::Deparse was Re: [ID 20000808.005] refs to returned lvalues are lvalues??
Message-ID: <slrn8p6ovk.5sh.simon@justanother.perlhacker.org>

p4raw-id: //depot/perl@6597

t/lib/b.t

index 96ba126..dba3852 100755 (executable)
--- 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';