1#!perl
2
3use strict;
4use warnings;
5
6use Test::More tests => 2409            # tests in require'd file
7                         + 6;           # tests in this file
8
9use lib 't';
10
11use Math::BigFloat::Subclass;
12
13our ($CLASS, $CALC);
14$CLASS = "Math::BigFloat::Subclass";
15$CALC  = Math::BigFloat->config()->{lib};       # backend
16
17require 't/bigfltpm.inc';	# perform same tests as bigfltpm
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 subclass is a Math::BigFloat, but not a Math::Bigint
26isa_ok($ms, 'Math::BigFloat');
27ok(!$ms->isa('Math::BigInt'),
28   "An object of class '" . ref($ms) . "' isn't a 'Math::BigFloat'");
29
30use Math::BigFloat;
31
32my $bf = Math::BigFloat->new(23);	# same as other
33$ms += $bf;
34is($ms, 46, '$ms is 46');
35is($ms->{_custom}, 1, '$ms has custom attribute $ms->{_custom}');
36is(ref($ms), $CLASS, "\$ms is not an object of class '$CLASS'");
37