Branch Coverage

blib/lib/JSON/Tiny.pm
Criterion Covered Total %
branch 74 76 97.3


line true false branch
43 21 51 defined $err ? :
52 1 2 defined $err ? :
56 1 4 if ref $_[0] eq 'ARRAY' or ref $_[0] eq 'HASH'
67 53 22 eval { do { die "Missing or empty input\n" unless length(local $_ = shift()); $_ = eval { do { &Encode::decode('UTF-8', $_, 1) } } unless shift(); die "Input is not UTF-8 encoded\n" unless defined $_; $$valueref = _decode_value(); return /\G[\x20\x09\x0a\x0d]*\z/cg || _throw('Unexpected data') } } ? :
70 1 74 unless length(local $_ = shift())
73 71 3 unless shift()
74 2 72 unless defined $_
94 26 44 if /\G[\x20\x09\x0a\x0d]*,/cg
97 41 3 if /\G[\x20\x09\x0a\x0d]*\]/cg
111 3 25 unless /\G[\x20\x09\x0a\x0d]*"/cg
118 1 24 unless /\G[\x20\x09\x0a\x0d]*:/cg
125 10 14 if /\G[\x20\x09\x0a\x0d]*,/cg
128 13 1 if /\G[\x20\x09\x0a\x0d]*\}/cg
145 2 69 unless (/\G"/cg)
146 1 1 if /\G[\x00-\x1f\\]/
152 63 6 if (index($str, '\\u') < 0)
163 5 8 if ($2) { }
170 3 5 if (($ord & 63488) == 55296)
173 1 2 unless ($ord & 64512) == 55296
177 1 1 unless $str =~ /\G\\u([Dd][C-Fc-f]..)/cg
198 46 125 if /\G"/cg
201 20 105 if /\G\{/cg
204 54 51 if /\G\[/cg
208 29 22 if defined $i
211 8 14 if /\Gtrue/cg
214 7 7 if /\Gfalse/cg
217 5 2 if /\Gnull/cg
244 88 55 if (my $ref = ref $value)
247 25 63 if $ref eq 'HASH'
250 44 19 if $ref eq 'ARRAY'
253 4 4 $$value ? :
8 11 if $ref eq 'SCALAR'
254 5 4 $value ? :
9 2 if $ref eq 'JSON::Tiny::_Bool'
257 2 0 if (&blessed($value) and my $sub = $value->can('TO_JSON'))
263 5 50 unless defined $value
273 19 4 if length $check and not $check ^ $check and 0 + $value eq $value and $value * 0 == 0
294 0 19 if (/\G\z/cg) { }