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_mbf.t
CommitLineData
ee15d750
JH
1#!/usr/bin/perl -w
2
ee15d750 3use strict;
06ce15ad 4use Test::More tests => 2360
9393ace2 5 + 6; # + our own tests
3167abe5
NC
6
7
8BEGIN { unshift @INC, 't'; }
ee15d750 9
dccbb853 10use Math::BigFloat::Subclass;
ee15d750 11
b3abae2a 12use vars qw ($class $try $x $y $f @args $ans $ans1 $ans1_str $setup $CL);
dccbb853 13$class = "Math::BigFloat::Subclass";
233f7bc0 14$CL = Math::BigFloat->config()->{lib}; # "Math::BigInt::Calc"; or FastCalc
ee15d750 15
4aa37faf 16require 't/bigfltpm.inc'; # perform same tests as bigfltpm
ee15d750 17
9393ace2 18###############################################################################
ee15d750 19# Now do custom tests for Subclass itself
dccbb853 20my $ms = $class->new(23);
3167abe5 21print "# Missing custom attribute \$ms->{_custom}" if !is (1, $ms->{_custom});
ee15d750 22
9393ace2 23# Check that subclass is a Math::BigFloat, but not a Math::Bigint
3167abe5
NC
24isa_ok ($ms, 'Math::BigFloat');
25isnt ($ms->isa('Math::BigInt'), 1);
9393ace2 26
ee15d750
JH
27use Math::BigFloat;
28
dccbb853 29my $bf = Math::BigFloat->new(23); # same as other
ee15d750 30$ms += $bf;
3167abe5
NC
31print "# Tried: \$ms += \$bf, got $ms" if !is (46, $ms);
32print "# Missing custom attribute \$ms->{_custom}" if !is (1, $ms->{_custom});
33print "# Wrong class: ref(\$ms) was ".ref($ms) if !is ($class, ref($ms));