From: Steve Peters Date: Wed, 9 May 2007 17:19:10 +0000 (+0000) Subject: Partial reversion of bignum-0.21 to get tests to pass again. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9ff703dd13e95d1b87541d7c0507f117841b1046;p=p5sagit%2Fp5-mst-13.2.git Partial reversion of bignum-0.21 to get tests to pass again. p4raw-id: //depot/perl@31184 --- diff --git a/lib/bignum.pm b/lib/bignum.pm index f63ca20..26140ec 100644 --- a/lib/bignum.pm +++ b/lib/bignum.pm @@ -1,7 +1,7 @@ package bignum; use 5.006002; -$VERSION = '0.21'; +$VERSION = '0.21_01'; use Exporter; @EXPORT_OK = qw( ); @EXPORT = qw( inf NaN ); @@ -156,7 +156,7 @@ sub import require Math::BigInt if $_lite == 0; # not already loaded? $class = 'Math::BigInt'; # regardless of MBIL or not } - push @import, $lib_kind => $lib if $lib ne ''; + push @import, 'try' => $lib if $lib ne ''; # Math::BigInt::Trace or plain Math::BigInt $class->import(@import, upgrade => $upgrade); diff --git a/lib/bignum/t/option_l.t b/lib/bignum/t/option_l.t index 24b53fd..f534183 100755 --- a/lib/bignum/t/option_l.t +++ b/lib/bignum/t/option_l.t @@ -1,7 +1,5 @@ #!/usr/bin/perl -w -# test the "l", "lib", "try" and "only" options: - use Test::More; use strict; @@ -10,39 +8,19 @@ BEGIN $| = 1; chdir 't' if -d 't'; unshift @INC, '../lib'; - plan tests => 19; + plan tests => 12; } use bignum; -my @W; -{ -# catch warnings: -no warnings 'redefine'; -*Carp::carp = sub { push @W, $_[0]; }; -} - 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" );'); is ($@,''); # ditto -is (scalar @W, 2, 'two warnings'); -like ($W[1], qr/fallback to Math::/, 'got fallback'); - -$rc = eval ('bignum->import( "try" => "foo" );'); -is ($@,''); # shouldn't die -$rc = eval ('bignum->import( "try" => "foo" );'); -is ($@,''); # ditto $rc = eval ('bignum->import( "foo" => "bar" );'); like ($@, qr/^Unknown option foo/i, 'died'); # should die -$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/)