From: Jesse Luehrs Date: Thu, 21 Apr 2011 05:55:03 +0000 (-0500) Subject: also use Eval::Closure in the test X-Git-Tag: 2.0100~58 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=eb4cc222991e509161ef9e03735ba26848d1ed17;p=gitmo%2FMoose.git also use Eval::Closure in the test --- diff --git a/t/type_constraints/util_std_type_constraints.t b/t/type_constraints/util_std_type_constraints.t index 0aaf02c..d98f16c 100644 --- a/t/type_constraints/util_std_type_constraints.t +++ b/t/type_constraints/util_std_type_constraints.t @@ -5,6 +5,7 @@ use warnings; use Test::More; +use Eval::Closure; use IO::File; use Moose::Util::TypeConstraints; use Scalar::Util qw( blessed openhandle ); @@ -1011,9 +1012,9 @@ sub test_constraint { my $inlined; if ( $type->has_inlined_type_constraint ) { - local $@; - $inlined = eval 'sub { ( ' . $type->_inline_check('$_[0]') . ' ) }'; - die $@ if $@; + $inlined = eval_closure( + source => 'sub { ( ' . $type->_inline_check('$_[0]') . ' ) }', + ); } for my $accept ( @{ $tests->{accept} || [] } ) {