summaryrefslogtreecommitdiff
path: root/cpan/Math-BigRat/t/bigratpm.inc
diff options
context:
space:
mode:
authorFlorian Ragwitz <rafl@debian.org>2010-09-15 16:54:22 +0200
committerFlorian Ragwitz <rafl@debian.org>2010-09-15 16:54:22 +0200
commitc32198f6de5a51e5a974fac12c99530219fa3797 (patch)
treec1ccbb982d2ba7d88f0ece22f2ed9cad8a62a7b5 /cpan/Math-BigRat/t/bigratpm.inc
parent1e7868346284e83b3b2359a1ae43d11a29cb8f00 (diff)
downloadperl-c32198f6de5a51e5a974fac12c99530219fa3797.tar.gz
Upgrade Math::BigRat from version 0.25 to 0.26
Lots of unnecessary test boilerplate has been removed, allowing us to remove the dist from both %abs and %temp_no_core in t/TEST.
Diffstat (limited to 'cpan/Math-BigRat/t/bigratpm.inc')
-rw-r--r--cpan/Math-BigRat/t/bigratpm.inc40
1 files changed, 10 insertions, 30 deletions
diff --git a/cpan/Math-BigRat/t/bigratpm.inc b/cpan/Math-BigRat/t/bigratpm.inc
index 3a9b851f84..11028569a1 100644
--- a/cpan/Math-BigRat/t/bigratpm.inc
+++ b/cpan/Math-BigRat/t/bigratpm.inc
@@ -1,6 +1,6 @@
#include this file into another test for subclass testing...
-ok ($class->config()->{lib},$CL);
+is ($class->config()->{lib},$CL);
$setup = '';
@@ -126,31 +126,24 @@ while (<DATA>)
if ($ans =~ m|^/(.*)$|)
{
my $pat = $1;
- if ($ans1 =~ /$pat/)
- {
- ok (1,1);
- }
- else
- {
- print "# '$try' expected: /$pat/ got: '$ans1'\n" if !ok(1,0);
- }
+ like ($ans1, qr/$pat/);
}
else
{
if ($ans eq "")
{
- ok_undef ($ans1);
+ is ($ans1, undef);
}
else
{
- print "# Tried: '$try'\n" if !ok ($ans1, $ans);
+ is ($ans1, $ans) or diag("Tried: '$try'");
# if (ref($ans1) eq "$class")
# {
# # float numbers are normalized (for now), so mantissa shouldn't have
# # trailing zeros
# #print $ans1->_trailing_zeros(),"\n";
# print "# Has trailing zeros after '$try'\n"
-# if !ok ($ans1->{_m}->_trailing_zeros(), 0);
+# if !is ($ans1->{_m}->_trailing_zeros(), 0);
# }
}
} # end pattern or string
@@ -160,28 +153,15 @@ while (<DATA>)
# check whether $class->new( Math::BigInt->new()) destroys it
# ($y == 12 in this case)
$x = Math::BigInt->new(1200); $y = $class->new($x);
-ok ($y,1200); ok ($x,1200);
+is ($y,1200); is ($x,1200);
###############################################################################
# zero,inf,one,nan
-$x = $class->new(2); $x->bzero(); ok_undef ($x->{_a}); ok_undef ($x->{_p});
-$x = $class->new(2); $x->binf(); ok_undef ($x->{_a}); ok_undef ($x->{_p});
-$x = $class->new(2); $x->bone(); ok_undef ($x->{_a}); ok_undef ($x->{_p});
-$x = $class->new(2); $x->bnan(); ok_undef ($x->{_a}); ok_undef ($x->{_p});
-
-1; # all done
-
-###############################################################################
-# Perl 5.005 does not like ok ($x,undef)
-
-sub ok_undef
- {
- my $x = shift;
-
- ok (1,1) and return if !defined $x;
- ok ($x,'undef');
- }
+$x = $class->new(2); $x->bzero(); is ($x->{_a}, undef); is ($x->{_p}, undef);
+$x = $class->new(2); $x->binf(); is ($x->{_a}, undef); is ($x->{_p}, undef);
+$x = $class->new(2); $x->bone(); is ($x->{_a}, undef); is ($x->{_p}, undef);
+$x = $class->new(2); $x->bnan(); is ($x->{_a}, undef); is ($x->{_p}, undef);
__DATA__
&digit