correct hints test when running in git checkout
[p5sagit/Eval-WithLexicals.git] / t / simple.t
index e4316f3..e8157ba 100644 (file)
@@ -27,4 +27,24 @@ is_deeply(
   'Inner scope plus lexical ok'
 );
 
+is_deeply(
+  [ $eval->eval('{ my $y = 0 }; $x') ],
+  [ 1 ],
+  'Inner scope and other lexical ok'
+);
+
+is_deeply(
+  [ keys %{$eval->lexicals} ],
+  [ '$x' ],
+  'No capture of invisible $y'
+);
+
+$eval->eval('my $y = sub { $_[0]+1 }');
+
+is_deeply(
+  [ $eval->eval('$y->(2)') ],
+  [ 3 ],
+  'Sub created ok'
+);
+
 done_testing;