stop compiling stuff in the Eval::Closure package directly
[gitmo/Eval-Closure.git] / t / compiling-package.t
CommitLineData
a0e934a6 1#!/usr/bin/env perl
2use strict;
3use warnings;
4use Test::More;
5
6use Eval::Closure;
7
8my $code = eval_closure(
9 source => 'no strict "refs"; sub { keys %{__PACKAGE__ . "::"} }',
10);
11
12# defining the sub { } creates __ANON__, calling 'no strict' creates BEGIN
13my @stash_keys = grep { $_ ne '__ANON__' && $_ ne 'BEGIN' } $code->();
14
15is_deeply([@stash_keys], [], "compiled in an empty package");
16
17done_testing;