diff options
author | Jesse Luehrs <doy@tozt.net> | 2010-10-20 01:58:04 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2010-10-20 01:58:04 -0500 |
commit | efb592ef997e1772dc8bc03724d40ba3efe27717 (patch) | |
tree | 8fc59aebd310326e5d13e92b5c7293ad17856bb0 /t | |
parent | bab696380211755ae2f827c5ea3c174f62151295 (diff) | |
download | eval-closure-efb592ef997e1772dc8bc03724d40ba3efe27717.tar.gz eval-closure-efb592ef997e1772dc8bc03724d40ba3efe27717.zip |
initial implementation
Diffstat (limited to 't')
-rw-r--r-- | t/01-basic.t | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/t/01-basic.t b/t/01-basic.t new file mode 100644 index 0000000..42e309a --- /dev/null +++ b/t/01-basic.t @@ -0,0 +1,23 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Test::More; + +use Eval::Closure 'eval_closure'; + +my $foo = []; + +my $code = eval_closure( + source => 'sub { push @$bar, @_ }', + environment => { + '$bar' => \$foo, + }, + name => 'test', +); +ok($code, "got something"); + +$code->(1); + +is_deeply($foo, [1], "got the right thing"); + +done_testing; |