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