In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/c7da42cc2bffbdf6f3cf7de8f80e9da2bf3320b9?hp=6347c79c0486278eba1f54cf5fffff03b907884f>
- Log ----------------------------------------------------------------- commit c7da42cc2bffbdf6f3cf7de8f80e9da2bf3320b9 Author: Father Chrysostomos <[email protected]> Date: Thu Sep 4 17:54:04 2014 -0700 Increase $bigint::VERSION to 0.37 M dist/bignum/lib/bigint.pm commit 30dce6d60dd7c4360727445cc9878174c587267a Author: Father Chrysostomos <[email protected]> Date: Thu Sep 4 17:53:30 2014 -0700 Increase $bignum::VERSION to 0.38 M dist/bignum/lib/bignum.pm commit c3f2d555181136cd649f2591b056e05b8bb960dc Author: Father Chrysostomos <[email protected]> Date: Thu Sep 4 17:53:12 2014 -0700 Increase $bigrat::VERSION to 0.37 M dist/bignum/lib/bigrat.pm commit 4243592d153c224a9191407449401d41c4bbe03a Author: Olivier Mengué <[email protected]> Date: Fri Sep 5 00:34:04 2014 +0200 bignum tests: use eval-block instead of eval-string M dist/bignum/t/option_l.t commit a51f27d4352ee4e828d8e5d73ebf56bc42769870 Author: Olivier Mengué <[email protected]> Date: Fri Sep 5 00:27:15 2014 +0200 bignum tests: use eval block to load Math::BigInt::Lite M dist/bignum/t/bn_lite.t M dist/bignum/t/br_lite.t commit 02b92a2210d0958ba3e8e5a43ad5337fb5bf16f3 Author: Olivier Mengué <[email protected]> Date: Fri Sep 5 00:17:23 2014 +0200 big{num,rat,int}: use eval block to load Math::BigInt::Lite M dist/bignum/lib/bigint.pm M dist/bignum/lib/bignum.pm M dist/bignum/lib/bigrat.pm ----------------------------------------------------------------------- Summary of changes: dist/bignum/lib/bigint.pm | 5 ++--- dist/bignum/lib/bignum.pm | 5 ++--- dist/bignum/lib/bigrat.pm | 5 ++--- dist/bignum/t/bn_lite.t | 3 +-- dist/bignum/t/br_lite.t | 3 +-- dist/bignum/t/option_l.t | 14 +++++++------- 6 files changed, 15 insertions(+), 20 deletions(-) diff --git a/dist/bignum/lib/bigint.pm b/dist/bignum/lib/bigint.pm index 993ea91..0d7bde9 100644 --- a/dist/bignum/lib/bigint.pm +++ b/dist/bignum/lib/bigint.pm @@ -1,7 +1,7 @@ package bigint; use 5.006; -$VERSION = '0.36'; +$VERSION = '0.37'; use Exporter; @ISA = qw( Exporter ); @EXPORT_OK = qw( PI e bpi bexp hex oct ); @@ -248,8 +248,7 @@ sub import # see if we can find Math::BigInt::Lite if (!defined $a && !defined $p) # rounding won't work to well { - eval 'require Math::BigInt::Lite;'; - if ($@ eq '') + if (eval { require Math::BigInt::Lite; 1 }) { @import = ( ); # :constant in Lite, not MBI Math::BigInt::Lite->import( ':constant' ); diff --git a/dist/bignum/lib/bignum.pm b/dist/bignum/lib/bignum.pm index 40aedce..33150a7 100644 --- a/dist/bignum/lib/bignum.pm +++ b/dist/bignum/lib/bignum.pm @@ -1,7 +1,7 @@ package bignum; use 5.006; -$VERSION = '0.37'; +$VERSION = '0.38'; use Exporter; @ISA = qw( bigint ); @EXPORT_OK = qw( PI e bexp bpi hex oct ); @@ -155,8 +155,7 @@ sub import # see if we can find Math::BigInt::Lite if (!defined $a && !defined $p) # rounding won't work to well { - eval 'require Math::BigInt::Lite;'; - if ($@ eq '') + if (eval { require Math::BigInt::Lite; 1 }) { @import = ( ); # :constant in Lite, not MBI Math::BigInt::Lite->import( ':constant' ); diff --git a/dist/bignum/lib/bigrat.pm b/dist/bignum/lib/bigrat.pm index adbeff4..5845523 100644 --- a/dist/bignum/lib/bigrat.pm +++ b/dist/bignum/lib/bigrat.pm @@ -1,7 +1,7 @@ package bigrat; use 5.006; -$VERSION = '0.36'; +$VERSION = '0.37'; require Exporter; @ISA = qw( bigint ); @EXPORT_OK = qw( PI e bpi bexp hex oct ); @@ -148,8 +148,7 @@ sub import # see if we can find Math::BigInt::Lite if (!defined $a && !defined $p) # rounding won't work to well { - eval 'require Math::BigInt::Lite;'; - if ($@ eq '') + if (eval { require Math::BigInt::Lite; 1 }) { @import = ( ); # :constant in Lite, not MBI Math::BigInt::Lite->import( ':constant' ); diff --git a/dist/bignum/t/bn_lite.t b/dist/bignum/t/bn_lite.t index 28e38c5..c2a04cd 100644 --- a/dist/bignum/t/bn_lite.t +++ b/dist/bignum/t/bn_lite.t @@ -5,8 +5,7 @@ use strict; use Test::More; -eval 'require Math::BigInt::Lite;'; -if ($@ eq '') +if (eval { require Math::BigInt::Lite; 1 }) { plan (tests => 1); # can use Lite, so let bignum try it diff --git a/dist/bignum/t/br_lite.t b/dist/bignum/t/br_lite.t index fd63252..4e75356 100644 --- a/dist/bignum/t/br_lite.t +++ b/dist/bignum/t/br_lite.t @@ -5,8 +5,7 @@ use strict; use Test::More; -eval 'require Math::BigInt::Lite;'; -if ($@ eq '') +if (eval { require Math::BigInt::Lite; 1 }) { plan (tests => 1); # can use Lite, so let bignum try it diff --git a/dist/bignum/t/option_l.t b/dist/bignum/t/option_l.t index d8c6b87..b5eddec 100644 --- a/dist/bignum/t/option_l.t +++ b/dist/bignum/t/option_l.t @@ -15,32 +15,32 @@ no warnings 'redefine'; *Carp::carp = sub { push @W, $_[0]; }; } -my $rc = eval ('bignum->import( "l" => "foo" );'); +my $rc = eval { bignum->import( "l" => "foo" ) }; is ($@,''); # shouldn't die is (scalar @W, 1, 'one warning'); like ($W[0], qr/fallback to Math::/, 'got fallback'); -$rc = eval ('bignum->import( "lib" => "foo" );'); +$rc = eval { bignum->import( "lib" => "foo" ) }; is ($@,''); # ditto is (scalar @W, 2, 'two warnings'); like ($W[1], qr/fallback to Math::/, 'got fallback'); -$rc = eval ('bignum->import( "try" => "foo" );'); +$rc = eval { bignum->import( "try" => "foo" ) }; is ($@,''); # shouldn't die -$rc = eval ('bignum->import( "try" => "foo" );'); +$rc = eval { bignum->import( "try" => "foo" ) }; is ($@,''); # ditto -$rc = eval ('bignum->import( "foo" => "bar" );'); +$rc = eval { bignum->import( "foo" => "bar" ) }; like ($@, qr/^Unknown option foo/i, 'died'); # should die -$rc = eval ('bignum->import( "only" => "bar" );'); +$rc = eval { bignum->import( "only" => "bar" ) }; like ($@, qr/fallback disallowed/i, 'died'); # should die # test that options are only lowercase (don't see a reason why allow UPPER) foreach (qw/L LIB Lib T Trace TRACE V Version VERSION/) { - $rc = eval ('bignum->import( "$_" => "bar" );'); + $rc = eval { bignum->import( $_ => "bar" ) }; like ($@, qr/^Unknown option $_/i, 'died'); # should die } -- Perl5 Master Repository
