add test to check non-capture of out of scope lexical
[p5sagit/Eval-WithLexicals.git] / 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;