more tests
Jesse Luehrs [Wed, 20 Oct 2010 22:41:47 +0000 (17:41 -0500)]
t/04-canonicalize-source.t [new file with mode: 0644]

diff --git a/t/04-canonicalize-source.t b/t/04-canonicalize-source.t
new file mode 100644 (file)
index 0000000..79c08a3
--- /dev/null
@@ -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;