#!/usr/bin/perl -w
BEGIN
{
$| = 1;
my
$location
= $0;
$location
=~ s/sub_mbf.t//i;
if
(
$ENV
{PERL_CORE})
{
@INC
=
qw(../t/lib)
;
}
unshift
@INC
,
'../lib'
;
if
(-d
't'
)
{
chdir
't'
;
unshift
@INC
, File::Spec->catdir(File::Spec->updir,
$location
);
}
else
{
unshift
@INC
,
$location
;
}
print
"# INC = @INC\n"
;
plan
tests
=> 2042
+ 6;
}
use
vars
qw ($class
$try
$x
$y
$f
@args
$ans
$ans1
$ans1_str
$setup
$CL
);
$class
=
"Math::BigFloat::Subclass"
;
$CL
= Math::BigFloat->config()->{lib};
require
'bigfltpm.inc'
;
my
$ms
=
$class
->new(23);
print
"# Missing custom attribute \$ms->{_custom}"
if
!ok (1,
$ms
->{_custom});
ok (
$ms
->isa(
'Math::BigFloat'
),1);
ok (
$ms
->isa(
'Math::BigInt'
) || 0,0);
my
$bf
= Math::BigFloat->new(23);
$ms
+=
$bf
;
print
"# Tried: \$ms += \$bf, got $ms"
if
!ok (46,
$ms
);
print
"# Missing custom attribute \$ms->{_custom}"
if
!ok (1,
$ms
->{_custom});
print
"# Wrong class: ref(\$ms) was "
.
ref
(
$ms
)
if
!ok (
$class
,
ref
(
$ms
));