blib/lib/JSON/backportPP/Boolean.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 3 | 9 | 33.3 |
branch | n/a | ||
condition | n/a | ||
subroutine | 1 | 4 | 25.0 |
pod | n/a | ||
total | 4 | 13 | 30.7 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package # This is JSON::backportPP | ||||||
2 | JSON::PP::Boolean; | ||||||
3 | |||||||
4 | 57 | 57 | 309 | use strict; | |||
57 | 89 | ||||||
57 | 6419 | ||||||
5 | require overload; | ||||||
6 | local $^W; | ||||||
7 | overload::unimport('overload', qw(0+ ++ -- fallback)); | ||||||
8 | overload::import('overload', | ||||||
9 | 0 | 0 | "0+" => sub { ${$_[0]} }, | ||||
0 | |||||||
10 | 0 | 0 | "++" => sub { $_[0] = ${$_[0]} + 1 }, | ||||
0 | |||||||
11 | 0 | 0 | "--" => sub { $_[0] = ${$_[0]} - 1 }, | ||||
0 | |||||||
12 | fallback => 1, | ||||||
13 | ); | ||||||
14 | |||||||
15 | $JSON::backportPP::Boolean::VERSION = '4.12'; | ||||||
16 | |||||||
17 | 1; | ||||||
18 | |||||||
19 | __END__ |