]> git.vpit.fr Git - perl/modules/Scope-Upper.git/blobdiff - t/20-localize-target.t
Fix "localize *x, 'y', $cx" to match Perl behaviour
[perl/modules/Scope-Upper.git] / t / 20-localize-target.t
index 56ebd978df5f747f571b6585808ddbb1dda2eb76..726a588d156763797c0f3523ae2556b305dcb14f 100644 (file)
@@ -32,14 +32,17 @@ sub _t { shift->{t} }
  is $x, undef, 'localize *x, obj => HERE [end]';
 }
 
+our $y;
+
 {
- local $x = 2;
+ local $x = 1;
+ local $y = 2;
  {
-  local $x = 3;
-  localize *x, 1 => HERE;
-  is $x, undef, 'localize *x, 1 => HERE [ok]';
+  local $y = 3;
+  localize *x, 'y' => HERE;
+  is $x, 3, "localize *x, 'y' => HERE [ok]";
  }
- is $x, $] < 5.008009 ? undef : 2, 'localize *x, 1 => HERE [end]';
+ is $x, 1, "localize *x, 'y' => HERE [end]";
 }
 undef *x;