X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fcompiling-package.t;fp=t%2Fcompiling-package.t;h=fa27d0ed97f52a1e0b3986540446685ab819bf07;hb=fa28785153da58de0024597ef6f360c9382aa478;hp=09b4d0bb61d64e885653c81dc01881aa1b600312;hpb=794dc9df98d2aaf2f143f32ac7dfa42fa46ce07e;p=gitmo%2FEval-Closure.git diff --git a/t/compiling-package.t b/t/compiling-package.t index 09b4d0b..fa27d0e 100644 --- a/t/compiling-package.t +++ b/t/compiling-package.t @@ -31,4 +31,14 @@ use Eval::Closure; is($c2->(), -2); } +{ + my $source = 'no strict "vars"; sub { ++$foo }'; + my $c1 = eval_closure(source => $source); + my $c2 = eval_closure(source => $source); + is($c1->(), 1); + is($c1->(), 2); + is($c2->(), 1); + is($c2->(), 2); +} + done_testing;