diff options
Diffstat (limited to 'lib/bignum/t/scope_r.t')
-rw-r--r-- | lib/bignum/t/scope_r.t | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/bignum/t/scope_r.t b/lib/bignum/t/scope_r.t index 888398867e..784fe0e6b0 100644 --- a/lib/bignum/t/scope_r.t +++ b/lib/bignum/t/scope_r.t @@ -1,7 +1,7 @@ #!/usr/bin/perl -w ############################################################################### -# Test no bigint; +# Test "no bigrat;" and overloading of hex()/oct() for newer Perls use Test::More; use strict; @@ -11,20 +11,31 @@ BEGIN $| = 1; chdir 't' if -d 't'; unshift @INC, '../lib'; - plan tests => 6; + plan tests => 10; } +# no :hex and :oct means these do not get overloaded for older Perls: use bigrat; isnt (ref(1), '', 'is in effect'); isnt (ref(2.0), '', 'is in effect'); isnt (ref(0x20), '', 'is in effect'); +SKIP: { + skip ('Need at least Perl v5.9.4', 2) if $] < 5.009004; + + is (ref(hex(9)), 'Math::BigInt', 'hex is overloaded'); + is (ref(oct(07)), 'Math::BigInt', 'oct is overloaded'); + } + { no bigrat; is (ref(1), '', 'is not in effect'); is (ref(2.0), '', 'is not in effect'); is (ref(0x20), '', 'is not in effect'); + + isnt (ref(hex(9)), 'Math::BigInt', 'hex is not overloaded'); + isnt (ref(oct(07)), 'Math::BigInt', 'oct is not overloaded'); } |