Bump $VERSION to 0.72_52
[p5sagit/Devel-Size.git] / t / recurse.t
index ddee1d8..01a9ba1 100644 (file)
@@ -8,8 +8,6 @@
 
 use Test::More;
 use strict;
-   
-my $tests;
 
 BEGIN
    {
@@ -28,8 +26,8 @@ can_ok ('Devel::Size', qw/
 
 Devel::Size->import( qw(size total_size) );
 
-die ("Uhoh, test uses outdated version of Devel::Size")
-  unless is ($Devel::Size::VERSION, '0.68', 'VERSION MATCHES');
+die ("Uhoh, test uses an outdated version of Devel::Size")
+  unless is ($Devel::Size::VERSION, '0.72_52', 'VERSION MATCHES');
 
 #############################################################################
 # verify that pointer sizes in array slots are sensible:
@@ -50,7 +48,9 @@ $ptr_size /= 4;
 
 my $hash = {};
 $hash->{a} = 1;
-is (total_size($hash), total_size( { a => undef } ) + total_size(1) - total_size(undef));
+is (total_size($hash),
+    total_size( { a => undef } ) + total_size(1) - total_size(undef),
+    'assert hash and hash key size');
 
 #############################################################################
 # #24846 (Does not correctly recurse into references in a PVNV-type scalar)
@@ -110,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:
@@ -136,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});