diff options
author | Jesse Luehrs <doy@tozt.net> | 2010-10-20 17:41:47 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2010-10-20 17:43:05 -0500 |
commit | a304773fd994852b0689ea3d95bda5de127d9c12 (patch) | |
tree | 4f7f64fa112c68bc28a650eda854cee50db3df72 /t | |
parent | 3efcc0874f36b6ce7acf839f017fc789abc40a8c (diff) | |
download | eval-closure-a304773fd994852b0689ea3d95bda5de127d9c12.tar.gz eval-closure-a304773fd994852b0689ea3d95bda5de127d9c12.zip |
more tests
Diffstat (limited to 't')
-rw-r--r-- | t/04-canonicalize-source.t | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/t/04-canonicalize-source.t b/t/04-canonicalize-source.t new file mode 100644 index 0000000..79c08a3 --- /dev/null +++ b/t/04-canonicalize-source.t @@ -0,0 +1,31 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Test::More; + +use Eval::Closure; + +{ + my $code = eval_closure( + source => + 'sub {' + . '"foo"' + . '}', + ); + ok($code, "got code"); + is($code->(), "foo", "got the right code"); +} + +{ + my $code = eval_closure( + source => [ + 'sub {', + '"foo"', + '}', + ], + ); + ok($code, "got code"); + is($code->(), "foo", "got the right code"); +} + +done_testing; |