summaryrefslogtreecommitdiff
path: root/t/canonicalize-source.t
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2015-05-12 04:54:59 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2015-05-12 04:54:59 +0000
commitcf3c05406f7cde406764915682e4bf5db73b1bdd (patch)
tree5050bd2311e38dc2b691a80ef187d2759a47e37b /t/canonicalize-source.t
downloadEval-Closure-tarball-master.tar.gz
Diffstat (limited to 't/canonicalize-source.t')
-rw-r--r--t/canonicalize-source.t31
1 files changed, 31 insertions, 0 deletions
diff --git a/t/canonicalize-source.t b/t/canonicalize-source.t
new file mode 100644
index 0000000..79c08a3
--- /dev/null
+++ b/t/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;