Move the $data and $result munging into the test preparation loop.
[p5sagit/p5-mst-13.2.git] / t / op / tie.t
index bd1e980..8cb4539 100755 (executable)
@@ -294,7 +294,6 @@ sub FETCH { *a = \1; 1 }
 tie $a, 'main';
 print $a;
 EXPECT
-Tied variable freed while still in use at - line 6.
 ########
 
 #  [20020716.007] - nested FETCHES
@@ -572,3 +571,17 @@ FIRSTKEY
 not empty
 FIRSTKEY
 empty
+########
+sub TIESCALAR { bless {} }
+sub FETCH { my $x = 3.3; 1 if 0+$x; $x }
+tie $h, "main";
+print $h,"\n";
+EXPECT
+3.3
+########
+sub TIESCALAR { bless {} }
+sub FETCH { shift()->{i} ++ }
+tie $h, "main";
+print $h.$h;
+EXPECT
+01