From efb592ef997e1772dc8bc03724d40ba3efe27717 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 20 Oct 2010 01:58:04 -0500 Subject: initial implementation --- t/01-basic.t | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 t/01-basic.t (limited to 't') 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; -- cgit v1.2.3-54-g00ecf