blib/lib/Mo/default.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 15 | 15 | 100.0 |
branch | 16 | 16 | 100.0 |
condition | 1 | 2 | 50.0 |
subroutine | 4 | 4 | 100.0 |
pod | n/a | ||
total | 36 | 37 | 97.3 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Mo::default; | ||||||
2 | $Mo::default::VERSION = '0.40';my$M="Mo::"; | ||||||
3 | $VERSION='0.40'; | ||||||
4 | 20 | 100 | 50 | 54 | 824 | *{$M.'default::e'}=sub{my($P,$e,$o)=@_;$o->{default}=sub{my($m,$n,%a)=@_;exists$a{default}or return$m;my($d,$r)=$a{default};my$g='HASH'eq($r=ref$d)?sub{+{%$d}}:'ARRAY'eq$r?sub{[@$d]}:'CODE'eq$r?$d:sub{$d};my$i=exists$a{lazy}?$a{lazy}:!${$P.':N'};$i or ${$P.':E'}{$n}=$g and return$m;sub{$#_?$m->(@_):!exists$_[0]{$n}?$_[0]{$n}=$g->(@_):$m->(@_)}}}; | |
7 | 100 | 96 | 70 | ||||
21 | 100 | 74 | 32 | ||||
21 | 100 | 52 | 39 | ||||
19 | 100 | 21 | |||||
19 | 100 | 63 | |||||
7 | 100 | 35 | |||||
4 | 100 | 16 | |||||
4 | 14 | ||||||
20 | 88 | ||||||
18 | 40 | ||||||
20 | 29 | ||||||
2 | 286 | ||||||
18 | 84 | ||||||
42 | 3697 |