4 use Test::More tests => 6;
6 ###############################################################################
7 package Math::BigFloat::Test;
12 @ISA = qw/Exporter Math::BigFloat/;
18 my ($self,$class) = @_;
19 return if $class =~ /^Math::Big(Int|Float)/; # we aren't one of these
20 UNIVERSAL::isa($self,$class);
25 return __PACKAGE__->new(123);
30 return __PACKAGE__->new(321);
33 ###############################################################################
36 # use Math::BigInt upgrade => 'Math::BigFloat';
37 use Math::BigFloat upgrade => 'Math::BigFloat::Test';
39 use vars qw ($scale $class $try $x $y $z $f @args $ans $ans1 $ans1_str $setup
41 $class = "Math::BigFloat";
42 $CL = "Math::BigInt::Calc";
43 $ECL = "Math::BigFloat::Test";
45 is (Math::BigFloat->upgrade(),$ECL);
46 is (Math::BigFloat->downgrade()||'','');
48 $x = $class->new(123); $y = $ECL->new(123); $z = $x->bmul($y);
49 is (ref($z),$ECL); is ($z,123);
51 $x = $class->new(123); $y = $ECL->new(123); $z = $x->badd($y);
52 is (ref($z),$ECL); is ($z,321);
57 # require 'upgrade.inc'; # all tests here for sharing