diff options
author | Jesse Luehrs <doy@tozt.net> | 2011-08-01 23:43:45 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2011-08-02 00:03:42 -0500 |
commit | a0e934a667e05d3a8b5556e257938472cd9d6243 (patch) | |
tree | 40e6a83bf3ab4bcb44ad387e1677472bb9de9615 /t | |
parent | 7fdc514fb2d9768b3d38d078cf24d9d03403539b (diff) | |
download | eval-closure-a0e934a667e05d3a8b5556e257938472cd9d6243.tar.gz eval-closure-a0e934a667e05d3a8b5556e257938472cd9d6243.zip |
stop compiling stuff in the Eval::Closure package directly
Diffstat (limited to 't')
-rw-r--r-- | t/compiling-package.t | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/t/compiling-package.t b/t/compiling-package.t new file mode 100644 index 0000000..5c3764f --- /dev/null +++ b/t/compiling-package.t @@ -0,0 +1,17 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Test::More; + +use Eval::Closure; + +my $code = eval_closure( + source => 'no strict "refs"; sub { keys %{__PACKAGE__ . "::"} }', +); + +# defining the sub { } creates __ANON__, calling 'no strict' creates BEGIN +my @stash_keys = grep { $_ ne '__ANON__' && $_ ne 'BEGIN' } $code->(); + +is_deeply([@stash_keys], [], "compiled in an empty package"); + +done_testing; |