summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2010-10-20 01:58:04 -0500
committerJesse Luehrs <doy@tozt.net>2010-10-20 01:58:04 -0500
commitefb592ef997e1772dc8bc03724d40ba3efe27717 (patch)
tree8fc59aebd310326e5d13e92b5c7293ad17856bb0 /t
parentbab696380211755ae2f827c5ea3c174f62151295 (diff)
downloadeval-closure-efb592ef997e1772dc8bc03724d40ba3efe27717.tar.gz
eval-closure-efb592ef997e1772dc8bc03724d40ba3efe27717.zip
initial implementation
Diffstat (limited to 't')
-rw-r--r--t/01-basic.t23
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;