blib/lib/Data/MessagePack/Boolean.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 13 | 15 | 86.6 |
branch | 2 | 2 | 100.0 |
condition | n/a | ||
subroutine | 5 | 6 | 83.3 |
pod | n/a | ||
total | 20 | 23 | 86.9 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Data::MessagePack::Boolean; | ||||||
2 | 36 | 36 | 261 | use strict; | |||
36 | 71 | ||||||
36 | 1170 | ||||||
3 | 36 | 36 | 188 | use warnings; | |||
36 | 66 | ||||||
36 | 3789 | ||||||
4 | use overload | ||||||
5 | 4 | 4 | 281 | 'bool' => sub { ${ $_[0] } }, | |||
4 | 17 | ||||||
6 | 0 | 0 | 0 | '0+' => sub { ${ $_[0] } }, | |||
0 | 0 | ||||||
7 | 536 | 100 | 536 | 343911 | '""' => sub { ${ $_[0] } ? 'true' : 'false' }, | ||
536 | 11543 | ||||||
8 | |||||||
9 | 36 | 479 | fallback => 1, | ||||
10 | 36 | 36 | 30310 | ; | |||
36 | 25007 | ||||||
11 | |||||||
12 | our $true = do { bless \(my $dummy = 1) }; | ||||||
13 | our $false = do { bless \(my $dummy = 0) }; | ||||||
14 | |||||||
15 | 1; |