From: Jesse Luehrs Date: Wed, 20 Oct 2010 22:41:47 +0000 (-0500) Subject: more tests X-Git-Tag: 0.01~14 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a304773fd994852b0689ea3d95bda5de127d9c12;p=gitmo%2FEval-Closure.git more tests --- 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;