diff options
Diffstat (limited to 'dist/Math-BigInt/t/isa.t')
-rw-r--r-- | dist/Math-BigInt/t/isa.t | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/dist/Math-BigInt/t/isa.t b/dist/Math-BigInt/t/isa.t index 9d7e824a16..0bdf66fda2 100644 --- a/dist/Math-BigInt/t/isa.t +++ b/dist/Math-BigInt/t/isa.t @@ -1,13 +1,9 @@ #!/usr/bin/perl -w -use Test; use strict; +use Test::More tests => 7; -BEGIN - { - unshift @INC, 't'; - plan tests => 7; - } +BEGIN { unshift @INC, 't'; } use Math::BigInt::Subclass; use Math::BigFloat::Subclass; @@ -19,21 +15,20 @@ $class = "Math::BigInt::Subclass"; $CL = "Math::BigInt::Calc"; # Check that a subclass is still considered a BigInt -ok ($class->new(123)->isa('Math::BigInt'),1); +isa_ok ($class->new(123), 'Math::BigInt'); # ditto for plain Math::BigInt -ok (Math::BigInt->new(123)->isa('Math::BigInt'),1); +isa_ok (Math::BigInt->new(123), 'Math::BigInt'); # But Math::BigFloats aren't -ok (Math::BigFloat->new(123)->isa('Math::BigInt') || 0,0); +isnt (Math::BigFloat->new(123)->isa('Math::BigInt'), 1); # see what happens if we feed a Math::BigFloat into new() $x = Math::BigInt->new(Math::BigFloat->new(123)); -ok (ref($x),'Math::BigInt'); -ok ($x->isa('Math::BigInt'),1); +is (ref($x),'Math::BigInt'); +isa_ok ($x, 'Math::BigInt'); # ditto for subclass $x = Math::BigInt->new(Math::BigFloat->new(123)); -ok (ref($x),'Math::BigInt'); -ok ($x->isa('Math::BigInt'),1); - +is (ref($x),'Math::BigInt'); +isa_ok ($x, 'Math::BigInt'); |