X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Frecurse.t;h=3f5d1b7190d72ba3e2345bbdebd1dbe31f970fb5;hb=f3cf7e20cc2a7a5a6cc4bdfa0b14812d47111a51;hp=4c67b29661d867322a7040650788f983189f4039;hpb=4a3d023dd5db197387dca602995d16f5a5ce5690;p=p5sagit%2FDevel-Size.git diff --git a/t/recurse.t b/t/recurse.t index 4c67b29..3f5d1b7 100644 --- a/t/recurse.t +++ b/t/recurse.t @@ -21,7 +21,7 @@ my %types = ( PVMG => do { my $a = $!; $a = "Bang!"; $a }, ); -plan(tests => 16 + 4 *12 + 2 * scalar keys %types); +plan(tests => 20 + 4 * 12 + 2 * scalar keys %types); ############################################################################# # verify that pointer sizes in array slots are sensible: @@ -282,3 +282,13 @@ sub cmp_array_ro { "Type $type, total_size() recurses to the referent"); } } + +{ + my $sub_size = total_size(\&cmp_array_ro); + cmp_ok($sub_size, '>=', 5120, 'subroutine is at least 5K'); + cmp_ok($sub_size, '<=', 51200, 'subroutine is no more than 50K') + or diag 'Is total_size() dragging in the entire symbol table?'; + cmp_ok(total_size(\%::), '>=', 10240, 'symbol table is at least 100K'); +} + +cmp_ok(total_size(\%Exporter::), '>', total_size(\%Exporter::Heavy::));