configure.com follow-up to 13218
[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 {
e745a66c 8 $| = 1;
e745a66c 9 # to locate the testing files
10 my $location = $0; $location =~ s/sub_mbi.t//i;
11 if ($ENV{PERL_CORE})
12 {
13 # testing with the core distribution
14 @INC = qw(../lib);
15 }
027dc388 16 unshift @INC, qw(../lib);
e745a66c 17 if (-d 't')
18 {
19 chdir 't';
20 require File::Spec;
21 unshift @INC, File::Spec->catdir(File::Spec->updir, $location);
22 }
23 else
24 {
25 unshift @INC, $location;
26 }
27 print "# INC = @INC\n";
28
027dc388 29 plan tests => 1669 + 4; # +4 own tests
ee15d750 30 }
31
dccbb853 32use Math::BigInt::Subclass;
ee15d750 33
34use vars qw ($class $try $x $y $f @args $ans $ans1 $ans1_str $setup);
dccbb853 35$class = "Math::BigInt::Subclass";
36
027dc388 37my $version = '0.01'; # for $VERSION tests, match current release (by hand!)
ee15d750 38
dccbb853 39require 'bigintpm.inc'; # perform same tests as bigfltpm
ee15d750 40
41# Now do custom tests for Subclass itself
dccbb853 42my $ms = $class->new(23);
ee15d750 43print "# Missing custom attribute \$ms->{_custom}" if !ok (1, $ms->{_custom});
44
dccbb853 45use Math::BigInt;
ee15d750 46
dccbb853 47my $bi = Math::BigInt->new(23); # same as other
48$ms += $bi;
49print "# Tried: \$ms += \$bi, got $ms" if !ok (46, $ms);
ee15d750 50print "# Missing custom attribute \$ms->{_custom}" if !ok (1, $ms->{_custom});
51print "# Wrong class: ref(\$ms) was ".ref($ms) if !ok ($class, ref($ms));