From: Karen Etheridge Date: Wed, 23 Apr 2014 05:43:19 +0000 (-0700) Subject: do { require ... } will explode if the require failed - need an eval here! X-Git-Tag: v1.002000~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b461f14367e615cc9fe83930e52094c36d173df3;p=p5sagit%2FJSON-MaybeXS.git do { require ... } will explode if the require failed - need an eval here! --- diff --git a/t/pp.t b/t/pp.t index f75fa20..6cef8af 100644 --- a/t/pp.t +++ b/t/pp.t @@ -1,7 +1,7 @@ use strict; use warnings FATAL => 'all'; use Test::Without::Module 'Cpanel::JSON::XS', 'JSON::XS'; -use if !do { require JSON::PP; 1; }, 'Test::More', skip_all => 'No JSON::PP'; +use if !eval { require JSON::PP; 1; }, 'Test::More', skip_all => 'No JSON::PP'; use Test::More; use JSON::MaybeXS; diff --git a/t/preload_cpanel.t b/t/preload_cpanel.t index 2c9243a..f3a4cef 100644 --- a/t/preload_cpanel.t +++ b/t/preload_cpanel.t @@ -1,6 +1,6 @@ use strict; use warnings FATAL => 'all'; -use if !do { require Cpanel::JSON::XS; 1; }, 'Test::More', skip_all => 'No Cpanel::JSON::XS'; +use if !eval { require Cpanel::JSON::XS; 1; }, 'Test::More', skip_all => 'No Cpanel::JSON::XS'; use Test::More; use JSON::MaybeXS; diff --git a/t/preload_xs.t b/t/preload_xs.t index aced987..01f14bc 100644 --- a/t/preload_xs.t +++ b/t/preload_xs.t @@ -1,6 +1,6 @@ use strict; use warnings FATAL => 'all'; -use if !do { require JSON::XS; 1; }, 'Test::More', skip_all => 'No JSON::XS'; +use if !eval { require JSON::XS; 1; }, 'Test::More', skip_all => 'No JSON::XS'; use Test::More; use JSON::MaybeXS;