9 # to locate the testing files
10 my $location = $0; $location =~ s/upgradef.t//i;
13 # testing with the core distribution
16 unshift @INC, qw(../lib); # to locate the modules
21 unshift @INC, File::Spec->catdir(File::Spec->updir, $location);
25 unshift @INC, $location;
27 print "# INC = @INC\n";
33 ###############################################################################
34 package Math::BigFloat::Test;
39 @ISA = qw/Exporter Math::BigFloat/;
45 my ($self,$class) = @_;
46 return if $class =~ /^Math::Big(Int|Float)/; # we aren't one of these
47 UNIVERSAL::isa($self,$class);
52 return __PACKAGE__->new(123);
57 return __PACKAGE__->new(321);
60 ###############################################################################
63 # use Math::BigInt upgrade => 'Math::BigFloat';
64 use Math::BigFloat upgrade => 'Math::BigFloat::Test';
66 use vars qw ($scale $class $try $x $y $z $f @args $ans $ans1 $ans1_str $setup
68 $class = "Math::BigFloat";
69 $CL = "Math::BigInt::Calc";
70 $ECL = "Math::BigFloat::Test";
72 ok (Math::BigFloat->upgrade(),$ECL);
73 ok (Math::BigFloat->downgrade()||'','');
75 $x = $class->new(123); $y = $ECL->new(123); $z = $x->bmul($y);
76 ok (ref($z),$ECL); ok ($z,123);
78 $x = $class->new(123); $y = $ECL->new(123); $z = $x->badd($y);
79 ok (ref($z),$ECL); ok ($z,321);
84 # require 'upgrade.inc'; # all tests here for sharing