This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update Math-BigInt to CPAN version 1.999811
[perl5.git] / cpan / Math-BigInt / t / req_mbfw.t
1 #!/usr/bin/perl
2
3 # check that requiring Math::BigFloat and then calling import() works
4
5 use strict;
6 use warnings;
7
8 use Test::More tests => 3;
9
10 use lib 't';
11
12 # normal require that calls import automatically (we thus have MBI afterwards)
13 require Math::BigFloat;
14
15 my $x = Math::BigFloat->new(1);
16 ++$x;
17 is($x, 2, '$x is 2');
18
19 like(Math::BigFloat->config()->{with}, qr/^Math::BigInt::(Fast)?Calc\z/,
20      '"with" ignored');
21
22 # now override
23 Math::BigFloat->import(with => 'Math::BigInt::Subclass');
24
25 # the "with" argument is ignored
26 like(Math::BigFloat->config()->{with}, qr/^Math::BigInt::(Fast)?Calc\z/,
27      '"with" ignored');
28
29 # all tests done