From 5617e9667fce453ffa66029ebc10c972a3066725 Mon Sep 17 00:00:00 2001 From: Shawn M Moore Date: Wed, 26 Jan 2011 21:31:55 -0500 Subject: Add a terse_error parameter to eval_closure --- t/10-errors.t | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 't') 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; -- cgit v1.2.3-54-g00ecf