blib/lib/Class/Cache/Test/Adder.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 10 | 10 | 100.0 |
branch | n/a | ||
condition | n/a | ||
subroutine | 3 | 3 | 100.0 |
pod | 0 | 2 | 0.0 |
total | 13 | 15 | 86.6 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Class::Cache::Test::Adder; | ||||||
2 | |||||||
3 | 3 | 3 | 753 | use Carp qw(cluck); | |||
3 | 5 | ||||||
3 | 500 | ||||||
4 | |||||||
5 | sub new { | ||||||
6 | 3 | 3 | 0 | 14 | my $class = shift; | ||
7 | |||||||
8 | 3 | 22 | bless {data => \@_}, __PACKAGE__; | ||||
9 | } | ||||||
10 | |||||||
11 | sub add { | ||||||
12 | 3 | 3 | 0 | 10 | my $self = shift; | ||
13 | 3 | 5 | my $sum; | ||||
14 | 3 | 9 | $sum += $_ for @{$self->{data}}; | ||||
3 | 30 | ||||||
15 | 3 | 52 | $sum; | ||||
16 | } | ||||||
17 | |||||||
18 | 1; |