1N/A#!/usr/bin/perl -w
1N/A
1N/A# check that requiring BigFloat and then calling import() works
1N/A
1N/Ause strict;
1N/Ause Test;
1N/A
1N/ABEGIN
1N/A {
1N/A $| = 1;
1N/A # to locate the testing files
1N/A my $location = $0; $location =~ s/req_mbfw.t//i;
1N/A if ($ENV{PERL_CORE})
1N/A {
1N/A # testing with the core distribution
1N/A @INC = qw(../t/lib);
1N/A }
1N/A unshift @INC, qw(../lib); # to locate the modules
1N/A if (-d 't')
1N/A {
1N/A chdir 't';
1N/A require File::Spec;
1N/A unshift @INC, File::Spec->catdir(File::Spec->updir, $location);
1N/A }
1N/A else
1N/A {
1N/A unshift @INC, $location;
1N/A }
1N/A print "# INC = @INC\n";
1N/A
1N/A plan tests => 3;
1N/A }
1N/A
1N/A# normal require that calls import automatically (we thus have MBI afterwards)
1N/Arequire Math::BigFloat; my $x = Math::BigFloat->new(1); ++$x; ok ($x,2);
1N/A
1N/Aok (Math::BigFloat->config()->{with}, 'Math::BigInt::Calc' );
1N/A
1N/A# now override
1N/AMath::BigFloat->import ( with => 'Math::BigInt::Subclass' );
1N/A
1N/A# thw with argument is ignored
1N/Aok (Math::BigFloat->config()->{with}, 'Math::BigInt::Calc' );
1N/A
1N/A# all tests done
1N/A