X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fcode.t;h=ab5d514804e8537718aeedd47b6f09ff7979fe5d;hb=574d9fd949280e15565bdd31f6d7c6b445e4884f;hp=65aca0e88297e7cffb09a082a1b3c0d04d43210e;hpb=57fcdb5b2135b53c38a100282adcf8a239eb918c;p=p5sagit%2FDevel-Size.git diff --git a/t/code.t b/t/code.t index 65aca0e..ab5d514 100644 --- a/t/code.t +++ b/t/code.t @@ -1,7 +1,7 @@ #!/usr/bin/perl -w use strict; -use Test::More tests => 8; +use Test::More tests => 10; use Devel::Size ':all'; sub zwapp; @@ -29,3 +29,14 @@ cmp_ok($anon_size, '>', 0, 'anonymous subroutines have a size'); cmp_ok(length prototype $anon_proto, '>', 0, 'prototype has a length'); cmp_ok($anon_proto_size, '>', $anon_size + length prototype $anon_proto, 'prototypes add to the size'); + +{ + use vars '@b'; + my $aelemfast_lex = total_size(sub {my @a; $a[0]}); + my $aelemfast = total_size(sub {my @a; $b[0]}); + + cmp_ok($aelemfast_lex, '>', $anon_size, + 'aelemfast for a lexical is handled correctly'); + cmp_ok($aelemfast, '>', $aelemfast_lex, + 'aelemfast for a package variable is larger'); +}