X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FDevel-Size.git;a=blobdiff_plain;f=t%2Fcode.t;h=1a7627655e3773e0895b0742c85d1151a939812d;hp=eed077908dbde1c34902fbe3ce537568ad3d20ba;hb=49a07034b9613683c5a80c1be2626e72a0bab5c8;hpb=75510c888a93290158c2310b4e24495de6f5c692 diff --git a/t/code.t b/t/code.t index eed0779..1a76276 100644 --- a/t/code.t +++ b/t/code.t @@ -1,7 +1,7 @@ #!/usr/bin/perl -w use strict; -use Test::More tests => 12; +use Test::More tests => 13; use Devel::Size ':all'; sub zwapp; @@ -53,3 +53,16 @@ my $short_pvop = total_size(sub {goto GLIT}); my $long_pvop = total_size(sub {goto KREEK_KREEK_CLANK_CLANK}); cmp_ok($short_pvop, '>', $anon_size, 'OPc_PVOP can be measured'); is($long_pvop, $short_pvop + 19, 'the only size difference is the label length'); + +sub bloop { + my $clunk = shift; + if (--$clunk > 0) { + bloop($clunk); + } +} + +my $before_size = total_size(\&bloop); +bloop(42); +my $after_size = total_size(\&bloop); + +cmp_ok($after_size, '>', $before_size, 'Recursion increases the PADLIST');