Branch Coverage

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


line true false branch
44 21 51 defined $err ? :
53 1 2 defined $err ? :
57 1 4 if ref $_[0] eq 'ARRAY' or ref $_[0] eq 'HASH'
68 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') } } ? :
71 1 74 unless length(local $_ = shift())
74 71 3 unless shift()
75 2 72 unless defined $_
95 26 44 if /\G[\x20\x09\x0a\x0d]*,/cg
98 41 3 if /\G[\x20\x09\x0a\x0d]*\]/cg
112 3 25 unless /\G[\x20\x09\x0a\x0d]*"/cg
119 1 24 unless /\G[\x20\x09\x0a\x0d]*:/cg
126 10 14 if /\G[\x20\x09\x0a\x0d]*,/cg
129 13 1 if /\G[\x20\x09\x0a\x0d]*\}/cg
146 2 69 unless (/\G"/cg)
147 1 1 if /\G[\x00-\x1f\\]/
153 63 6 if (index($str, '\\u') < 0)
164 5 8 if ($2) { }
171 3 5 if (($ord & 63488) == 55296)
174 1 2 unless ($ord & 64512) == 55296
178 1 1 unless $str =~ /\G\\u([Dd][C-Fc-f]..)/cg
199 46 125 if /\G"/cg
202 20 105 if /\G\{/cg
205 54 51 if /\G\[/cg
209 29 22 if defined $i
212 8 14 if /\Gtrue/cg
215 7 7 if /\Gfalse/cg
218 5 2 if /\Gnull/cg
245 88 55 if (my $ref = ref $value)
248 25 63 if $ref eq 'HASH'
251 44 19 if $ref eq 'ARRAY'
254 4 4 $$value ? :
8 11 if $ref eq 'SCALAR'
255 5 4 $value ? :
9 2 if $ref eq 'JSON::Tiny::_Bool'
258 2 0 if (&blessed($value) and my $sub = $value->can('TO_JSON'))
264 5 50 unless defined $value
269 19 4 if B::svref_2object(\$value)->FLAGS & 12288 and 0 + $value eq $value and $value * 0 == 0
287 0 19 if (/\G\z/cg) { }