This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade Math::BigInt from 1.999701 to 1.999704
[perl5.git] / cpan / Math-BigInt / t / sub_mbi.t
CommitLineData
ee15d750
JH
1#!/usr/bin/perl -w
2
ee15d750 3use strict;
06ce15ad 4use Test::More tests => 3701
07d34614 5 + 5; # +5 own tests
3167abe5
NC
6
7BEGIN { unshift @INC, 't'; }
ee15d750 8
dccbb853 9use Math::BigInt::Subclass;
ee15d750 10
394e6ffb 11use vars qw ($class $try $x $y $f @args $ans $ans1 $ans1_str $setup $CL);
dccbb853 12$class = "Math::BigInt::Subclass";
394e6ffb 13$CL = "Math::BigInt::Calc";
dccbb853 14
394e6ffb 15my $version = '0.02'; # for $VERSION tests, match current release (by hand!)
ee15d750 16
4aa37faf 17require 't/bigintpm.inc'; # perform same tests as bigintpm
ee15d750 18
9393ace2 19###############################################################################
ee15d750 20# Now do custom tests for Subclass itself
d5735945 21
dccbb853 22my $ms = $class->new(23);
3167abe5 23print "# Missing custom attribute \$ms->{_custom}" if !is (1, $ms->{_custom});
ee15d750 24
9393ace2 25# Check that a subclass is still considered a BigInt
3167abe5 26isa_ok ($ms, 'Math::BigInt');
9393ace2 27
dccbb853 28use Math::BigInt;
ee15d750 29
dccbb853
JH
30my $bi = Math::BigInt->new(23); # same as other
31$ms += $bi;
3167abe5
NC
32print "# Tried: \$ms += \$bi, got $ms" if !is (46, $ms);
33print "# Missing custom attribute \$ms->{_custom}" if !is (1, $ms->{_custom});
34print "# Wrong class: ref(\$ms) was ".ref($ms) if !is ($class, ref($ms));