Commit | Line | Data |
ee15d750 |
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 |
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 |
16 | use Math::BigInt::Subclass; |
ee15d750 |
17 | |
18 | use 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 |
23 | require 'bigintpm.inc'; # perform same tests as bigfltpm |
ee15d750 |
24 | |
25 | # Now do custom tests for Subclass itself |
dccbb853 |
26 | my $ms = $class->new(23); |
ee15d750 |
27 | print "# Missing custom attribute \$ms->{_custom}" if !ok (1, $ms->{_custom}); |
28 | |
dccbb853 |
29 | use Math::BigInt; |
ee15d750 |
30 | |
dccbb853 |
31 | my $bi = Math::BigInt->new(23); # same as other |
32 | $ms += $bi; |
33 | print "# Tried: \$ms += \$bi, got $ms" if !ok (46, $ms); |
ee15d750 |
34 | print "# Missing custom attribute \$ms->{_custom}" if !ok (1, $ms->{_custom}); |
35 | print "# Wrong class: ref(\$ms) was ".ref($ms) if !ok ($class, ref($ms)); |