Upgrade to Math::BigInt 1.45; from Tels.
[p5sagit/p5-mst-13.2.git] / lib / Math / BigInt / t / sub_mbf.t
1 #!/usr/bin/perl -w
2
3 use Test;
4 use strict;
5
6 BEGIN
7   {
8   $| = 1;
9   unshift @INC, '../lib';       # for running manually
10   my $location = $0; $location =~ s/sub_mbf.t//;
11   unshift @INC, $location; # to locate the testing files
12   chdir 't' if -d 't';
13   plan tests => 1277 + 4;       # + 4 own tests
14   }
15
16 use Math::BigFloat::Subclass;
17
18 use vars qw ($class $try $x $y $f @args $ans $ans1 $ans1_str $setup);
19 $class = "Math::BigFloat::Subclass";
20
21 require 'bigfltpm.inc'; # perform same tests as bigfltpm
22
23 # Now do custom tests for Subclass itself
24 my $ms = $class->new(23);
25 print "# Missing custom attribute \$ms->{_custom}" if !ok (1, $ms->{_custom});
26
27 use Math::BigFloat;
28
29 my $bf = Math::BigFloat->new(23);               # same as other
30 $ms += $bf;
31 print "# Tried: \$ms += \$bf, got $ms" if !ok (46, $ms);
32 print "# Missing custom attribute \$ms->{_custom}" if !ok (1, $ms->{_custom});
33 print "# Wrong class: ref(\$ms) was ".ref($ms) if !ok ($class, ref($ms));