blib/lib/Test/Evo/Helpers.pm untested

filter: Statementstmt 0.0% 0 / 15 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 26 CC 2 SCAR 13.9
CC
2
Cov
0%
test_memory
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 4.0
1 package Test::Evo::Helpers;
2 use Evo '-Export *';
3  
4 sub test_memory ($count, $limit, $code) : Export {
5 require Memory::Stats;
6 my $stats = Memory::Stats->new;
7 {
8 $stats->start;
9 $code->() for 1 .. $count;
10 }
11 $stats->stop;
12 my $consumed = $stats->usage;
13 die "consumed $consumed bytes, threshold is: $limit" if $limit && $stats->usage > $limit;
14 $consumed;
15 }
16  
17 1;
18  
19 __END__