This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade to Math::BigInt 1.44 from Tels and
[perl5.git] / lib / Math / BigInt / t / subclass.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/subclass.t//;
11   unshift @INC, $location; # to locate the testing files
12   #chdir 't' if -d 't';
13   plan tests => 1277;
14   }
15
16 use Math::BigInt;
17 use Math::Subclass;
18
19 use vars qw ($class $try $x $y $f @args $ans $ans1 $ans1_str $setup);
20 $class = "Math::Subclass";
21
22 require 'bigfltpm.inc'; # perform same tests as bigfltpm
23
24 # Now do custom tests for Subclass itself
25 my $ms = new Math::Subclass 23;
26 print "# Missing custom attribute \$ms->{_custom}" if !ok (1, $ms->{_custom});
27
28 use Math::BigFloat;
29
30 my $bf = new Math::BigFloat 23; # same as other
31 $ms += $bf;
32 print "# Tried: \$ms += \$bf, got $ms" if !ok (46, $ms);
33 print "# Missing custom attribute \$ms->{_custom}" if !ok (1, $ms->{_custom});
34 print "# Wrong class: ref(\$ms) was ".ref($ms) if !ok ($class, ref($ms));