X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Frecurse.t;h=00233b82967da429ac40cbaa11dc03f6d9ffa4e3;hb=1c566e6ab8500795b29fd593e67aa8d6f1aa9b0b;hp=845e825d574a234a34af5242f1b1a8c9e457e11e;hpb=7089796d3c88758e1be965bbdbf35056e4196ad1;p=p5sagit%2FDevel-Size.git diff --git a/t/recurse.t b/t/recurse.t index 845e825..00233b8 100644 --- a/t/recurse.t +++ b/t/recurse.t @@ -9,8 +9,6 @@ use Test::More; use strict; -my $tests; - BEGIN { chdir 't' if -d 't'; @@ -112,8 +110,8 @@ for my $size (2, 3, 7, 100) # Get the size of the PVNV and the contained array my $element_size = total_size(\$hash->{a}); - ok ($element_size < total_size($hash), "element < hash with one element"); - ok ($element_size > total_size(\[]), "PVNV + [] > [] alone"); + cmp_ok($element_size, '<', total_size($hash), "element < hash with one element"); + cmp_ok($element_size, '>', total_size(\[]), "PVNV + [] > [] alone"); # Dereferencing the PVNV (the argument to total_size) leaves us with # just the array, and this should be equal to a dereferenced array: @@ -138,7 +136,7 @@ for my $size (2, 3, 7, 100) # is a PVNV, so they shouldn't be the same: isnt (total_size(\[0..$size]), total_size( \$hash->{a} ), "[0..size] vs PVNV"); # and the plain ref should be smaller - ok (total_size(\[0..$size]) < total_size( \$hash->{a} ), "[0..size] vs. PVNV"); + cmp_ok(total_size(\[0..$size]), '<', total_size( \$hash->{a} ), "[0..size] vs. PVNV"); $full_hash = total_size($hash); $element_size = total_size(\$hash->{a});