Branch Coverage

blib/lib/ThaiSchema/JSON.pm
Criterion Covered Total %
branch 71 104 68.2


line true false branch
55 0 0 @_ > 1 ? :
0 40 @_ ? :
59 47 47 if @_ > 1
75 0 39 unless $bytes
83 0 39 unless utf8::downgrade($bytes, 1)
92 0 39 unless $d_res
103 20 19 if (/\G\[/cg) { }
19 0 elsif (/\G\{/cg) { }
104 1 19 unless ($schema->is_array)
112 1 18 unless ($schema->is_hash)
122 0 31 unless (/\G$WHITESPACE_RE\z/cg)
123 0 0 ref $ref eq 'ARRAY' ? :
131 8 31 if (not $res and my $e = $@)
136 8 31 if ($self->error)
147 16 0 $_NAME ? :
173 0 20 if /\G$WHITESPACE_RE,/cg
176 20 0 if /\G$WHITESPACE_RE\]/cg
194 0 25 unless /\G$WHITESPACE_RE"/cg
201 0 25 unless /\G$WHITESPACE_RE:/cg
207 19 6 if ($cschema) { }
210 5 1 if ($ThaiSchema::ALLOW_EXTRA) { }
218 5 18 if /\G$WHITESPACE_RE,/cg
221 18 0 if /\G$WHITESPACE_RE\}/cg
228 1 19 if (%schema)
243 0 31 unless (/\G"/cg)
244 0 0 if /\G[\x00-\x1F\\]/
251 31 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 7 130 if (ref $schema eq 'HASH') { }
2 128 elsif (ref $schema eq 'ARRAY') { }
300 0 2 if (@$schema > 1)
316 6 42 if (/\G"/cg)
317 4 2 unless ($schema->is_string)
324 9 33 if (/\G\[/cg)
325 2 7 unless ($schema->is_array)
333 7 26 if (/\G\{/cg)
334 3 4 unless ($schema->is_hash)
342 15 11 if (/\G([-]?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?)/cg)
344 2 13 unless ($schema->is_number)
347 1 14 if ($schema->is_integer and int $number != $number)
355 6 5 if (/\Gtrue/cg)
356 2 4 unless ($schema->is_bool)
363 2 3 if (/\Gfalse/cg)
364 1 1 unless ($schema->is_bool)
371 3 0 if (/\Gnull/cg)
372 2 1 unless ($schema->is_null)
389 6 2 if $_NAME
391 0 8 if (/\G\z/cg) { }
409 0 0 if (/\G\z/cg) { }