Another ex-PVBM assert
[p5sagit/p5-mst-13.2.git] / t / op / local.t
index e95615e..ee250e1 100755 (executable)
@@ -5,7 +5,7 @@ BEGIN {
     @INC = qw(. ../lib);
     require './test.pl';
 }
-plan tests => 120;
+plan tests => 122;
 
 my $list_assignment_supported = 1;
 
@@ -331,13 +331,10 @@ like($@, qr/Modification of a read-only value attempted/);
 eval { for("a") { for $x (1,2) { local $_="b"; s/(.*)/+$1/ } } };
 is($@, "");
 
-# Special local() behavior for $[
-# (see RT #38207 - Useless localization of constant ($[) in getopts.pl}
+# RT #4342 Special local() behavior for $[
 {
     local $[ = 1;
-    local $TODO = "local() not currently working correctly with \$[";
-    ok(1 == $[);
-    undef $TODO;
+    ok(1 == $[, 'lexcical scope of local $[');
     f();
 }
 
@@ -453,3 +450,12 @@ sub f { ok(0 == $[); }
     ok(! exists($h{'k2'}));
     is($h{'k1'},111);
 }
+
+# Keep this test last, as it can SEGV
+{
+    local *@;
+    pass("Localised *@");
+    eval {1};
+    pass("Can eval with *@ localised");
+}
+