X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F10-errors.t;h=905d6c847a24c1a2be34ab4ca7baef819435407a;hb=5617e9667fce453ffa66029ebc10c972a3066725;hp=e724e78f203b697238dd56659fc67ca04d05a61e;hpb=c43189112c58a6c5c771c7a52d11fb8e6b79b16b;p=gitmo%2FEval-Closure.git diff --git a/t/10-errors.t b/t/10-errors.t index e724e78..905d6c8 100644 --- a/t/10-errors.t +++ b/t/10-errors.t @@ -52,4 +52,16 @@ like( "gives us compile errors properly" ); +like( + exception { eval_closure(source => 'sub { $x }') }, + qr/sub \s* { \s* \$x \s* }/x, + "without terse_error, includes the source code" +); + +unlike( + exception { eval_closure(source => 'sub { $x }', terse_error => 1) }, + qr/sub \s* { \s* \$x \s* }/x, + "with terse_error, does not include the source code" +); + done_testing;