1# -*- mode: perl; -*-
2
3###############################################################################
4# Test "no bigint;" and overloading of hex()/oct() for newer Perls
5
6use strict;
7use warnings;
8
9use Test::More tests => 10;
10
11# no :hex and :oct means these do not get overloaded for older Perls:
12use bigint;
13
14isnt(ref(1),    '', 'is in effect');
15isnt(ref(2.0),  '', 'is in effect');
16isnt(ref(0x20), '', 'is in effect');
17
18SKIP: {
19    # Quote numbers due to "use bigint;"
20    skip('Need at least Perl v5.9.4', "2") if $] < "5.009004";
21
22    is(ref(hex(9)),  'Math::BigInt', 'hex is overloaded');
23    is(ref(oct(07)), 'Math::BigInt', 'oct is overloaded');
24}
25
26{
27    no bigint;
28
29    is(ref(1),    '', 'is not in effect');
30    is(ref(2.0),  '', 'is not in effect');
31    is(ref(0x20), '', 'is not in effect');
32
33    is(ref(hex(9)),  '', 'hex is not overloaded');
34    is(ref(oct(07)), '', 'oct is not overloaded');
35}
36