summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorShawn M Moore <sartak@bestpractical.com>2011-01-26 21:31:55 -0500
committerShawn M Moore <sartak@bestpractical.com>2011-01-26 22:01:43 -0500
commit5617e9667fce453ffa66029ebc10c972a3066725 (patch)
treed8dbe1c3ddb9000cc215f4998c88c0398f5cf8bc /t
parentc43189112c58a6c5c771c7a52d11fb8e6b79b16b (diff)
downloadeval-closure-5617e9667fce453ffa66029ebc10c972a3066725.tar.gz
eval-closure-5617e9667fce453ffa66029ebc10c972a3066725.zip
Add a terse_error parameter to eval_closure
Diffstat (limited to 't')
-rw-r--r--t/10-errors.t12
1 files changed, 12 insertions, 0 deletions
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;