just export eval_closure by default
[gitmo/Eval-Closure.git] / t / 01-basic.t
1 #!/usr/bin/env perl
2 use strict;
3 use warnings;
4 use Test::More;
5
6 use Eval::Closure;
7
8 my $foo = [];
9
10 my $code = eval_closure(
11     source      => 'sub { push @$bar, @_ }',
12     environment => {
13         '$bar' => \$foo,
14     },
15     name        => 'test',
16 );
17 ok($code, "got something");
18
19 $code->(1);
20
21 is_deeply($foo, [1], "got the right thing");
22
23 done_testing;