Fix test for overload in given() with smart match after last change
[p5sagit/p5-mst-13.2.git] / t / op / sub_lval.t
index 2e4db52..a159bac 100755 (executable)
@@ -3,7 +3,7 @@ BEGIN {
     @INC = '../lib';
     require './test.pl';
 }
-plan tests=>68;
+plan tests=>69;
 
 sub a : lvalue { my $a = 34; ${\(bless \$a)} }  # Return a temporary
 sub b : lvalue { ${\shift} }
@@ -539,3 +539,14 @@ TODO: {
 
     is($line, "zeroonetwothree");
 }
+
+{
+    package Foo;
+    sub AUTOLOAD :lvalue { *{$AUTOLOAD} };
+    package main;
+    my $foo = bless {},"Foo";
+    my $result;
+    $foo->bar = sub { $result = "bar" };
+    $foo->bar;
+    is ($result, 'bar', "RT #41550");
+}