1#!/usr/bin/perl 2 3use strict; 4use warnings; 5 6use Test::More tests => 4026 # tests in require'd file 7 + 5; # tests in this file 8 9use lib 't'; 10 11use Math::BigInt::Subclass; 12 13our ($CLASS, $LIB); 14$CLASS = "Math::BigInt::Subclass"; 15$LIB = "Math::BigInt::Calc"; # backend 16 17require './t/bigintpm.inc'; # perform same tests as bigintpm 18 19############################################################################### 20# Now do custom tests for Subclass itself 21 22my $ms = $CLASS->new(23); 23is($ms->{_custom}, 1, '$ms has custom attribute \$ms->{_custom}'); 24 25# Check that a subclass is still considered a Math::BigInt 26isa_ok($ms, 'Math::BigInt'); 27 28use Math::BigInt; 29 30my $bi = Math::BigInt->new(23); # same as other 31$ms += $bi; 32is($ms, 46, '$ms is 46'); 33is($ms->{_custom}, 1, '$ms has custom attribute $ms->{_custom}'); 34is(ref($ms), $CLASS, "\$ms is not an object of class '$CLASS'"); 35