From a304773fd994852b0689ea3d95bda5de127d9c12 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 20 Oct 2010 17:41:47 -0500 Subject: more tests --- t/04-canonicalize-source.t | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 t/04-canonicalize-source.t (limited to 't') 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; -- cgit v1.2.3-54-g00ecf