X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FEval-WithLexicals.git;a=blobdiff_plain;f=t%2Fsimple.t;h=e8157ba78d639cf843c4ee53fbdef992d0888e10;hp=22ea7c480a93b442df7411b0300593b6e30cfc8e;hb=2b376bd0dc102f9019e007d889a844f94b3a87b9;hpb=40d8277ffc4b65605b2c972b269dfcda92c88fca diff --git a/t/simple.t b/t/simple.t index 22ea7c4..e8157ba 100644 --- a/t/simple.t +++ b/t/simple.t @@ -33,4 +33,18 @@ is_deeply( '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;