Branch Coverage

blib/lib/ThaiSchema/JSON.pm
Criterion Covered Total %
branch 73 106 68.8


line true false branch
55 0 0 @_ > 1 ? :
0 41 @_ ? :
59 49 49 if @_ > 1
75 0 41 unless $bytes
83 0 41 unless utf8::downgrade($bytes, 1)
92 0 41 unless $d_res
103 20 21 if (/\G\[/cg) { }
21 0 elsif (/\G\{/cg) { }
104 1 19 unless ($schema->is_array)
112 1 20 unless ($schema->is_hash)
122 0 33 unless (/\G$WHITESPACE_RE\z/cg)
123 0 0 ref $ref eq 'ARRAY' ? :
131 8 33 if (not $res and my $e = $@)
136 8 33 if ($self->error)
147 16 0 $_NAME ? :
173 0 20 if /\G$WHITESPACE_RE,/cg
176 20 0 if /\G$WHITESPACE_RE\]/cg
190 1 24 $schema->isa('ThaiSchema::Maybe') ? :
194 0 28 unless /\G$WHITESPACE_RE"/cg
201 0 28 unless /\G$WHITESPACE_RE:/cg
207 22 6 if ($cschema) { }
210 5 1 if ($ThaiSchema::ALLOW_EXTRA) { }
218 5 21 if /\G$WHITESPACE_RE,/cg
221 21 0 if /\G$WHITESPACE_RE\}/cg
228 1 22 if (%schema)
243 0 34 unless (/\G"/cg)
244 0 0 if /\G[\x00-\x1F\\]/
251 34 0 if (index($str, '\\u') < 0)
262 0 0 if ($2) { }
269 0 0 if (($ord & 63488) == 55296)
272 0 0 unless ($ord & 64512) == 55296
277 0 0 unless $str =~ /\G\\u([Dd][C-Fc-f]..)/cg
297 9 136 if (ref $schema eq 'HASH') { }
2 134 elsif (ref $schema eq 'ARRAY') { }
300 0 2 if (@$schema > 1)
316 6 45 if (/\G"/cg)
317 4 2 unless ($schema->is_string)
324 9 36 if (/\G\[/cg)
325 2 7 unless ($schema->is_array)
333 8 28 if (/\G\{/cg)
334 3 5 unless ($schema->is_hash)
342 16 12 if (/\G([-]?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?)/cg)
344 2 14 unless ($schema->is_number)
347 1 15 if ($schema->is_integer and int $number != $number)
355 6 6 if (/\Gtrue/cg)
356 2 4 unless ($schema->is_bool)
363 2 4 if (/\Gfalse/cg)
364 1 1 unless ($schema->is_bool)
371 4 0 if (/\Gnull/cg)
372 2 2 unless ($schema->is_null)
389 6 2 if $_NAME
391 0 8 if (/\G\z/cg) { }
409 0 0 if (/\G\z/cg) { }