diff options
author | Ricardo Signes <rjbs@cpan.org> | 2015-09-05 10:20:42 -0400 |
---|---|---|
committer | Ricardo Signes <rjbs@cpan.org> | 2015-09-06 15:31:21 -0400 |
commit | 6b0f9b46aaa4198a1e8ed620a940f4f2bd304859 (patch) | |
tree | 5aa61fa3f398429b6c615b38c91a4232a6139d29 /cpan/Math-BigInt/t/sub_mbi.t | |
parent | 361334bbfb74d04f2a6294a43be24dbe29ba16c0 (diff) | |
download | perl-6b0f9b46aaa4198a1e8ed620a940f4f2bd304859.tar.gz |
move Math-Big* from ./dist to ./cpan
Diffstat (limited to 'cpan/Math-BigInt/t/sub_mbi.t')
-rw-r--r-- | cpan/Math-BigInt/t/sub_mbi.t | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/cpan/Math-BigInt/t/sub_mbi.t b/cpan/Math-BigInt/t/sub_mbi.t new file mode 100644 index 0000000000..b8e0a027ea --- /dev/null +++ b/cpan/Math-BigInt/t/sub_mbi.t @@ -0,0 +1,34 @@ +#!/usr/bin/perl -w + +use strict; +use Test::More tests => 3649 + + 5; # +5 own tests + +BEGIN { unshift @INC, 't'; } + +use Math::BigInt::Subclass; + +use vars qw ($class $try $x $y $f @args $ans $ans1 $ans1_str $setup $CL); +$class = "Math::BigInt::Subclass"; +$CL = "Math::BigInt::Calc"; + +my $version = '0.02'; # for $VERSION tests, match current release (by hand!) + +require 't/bigintpm.inc'; # perform same tests as bigintpm + +############################################################################### +# Now do custom tests for Subclass itself + +my $ms = $class->new(23); +print "# Missing custom attribute \$ms->{_custom}" if !is (1, $ms->{_custom}); + +# Check that a subclass is still considered a BigInt +isa_ok ($ms, 'Math::BigInt'); + +use Math::BigInt; + +my $bi = Math::BigInt->new(23); # same as other +$ms += $bi; +print "# Tried: \$ms += \$bi, got $ms" if !is (46, $ms); +print "# Missing custom attribute \$ms->{_custom}" if !is (1, $ms->{_custom}); +print "# Wrong class: ref(\$ms) was ".ref($ms) if !is ($class, ref($ms)); |