add test to check non-capture of out of scope lexical
Matt S Trout [Sun, 5 Dec 2010 16:43:02 +0000 (16:43 +0000)]
t/simple.t

index 22ea7c4..d529ac8 100644 (file)
@@ -33,4 +33,10 @@ is_deeply(
   'Inner scope and other lexical ok'
 );
 
+is_deeply(
+  [ keys %{$eval->lexicals} ],
+  [ '$x' ],
+  'No capture of invisible $y'
+);
+
 done_testing;