Branch Coverage

blib/lib/TOON/PP.pm
Criterion Covered Total %
branch 84 144 58.3


line true false branch
34 0 3 if ($state->{'pos'} < $state->{'len'})
42 0 8 unless defined $value
44 0 8 if (builtin::blessed($value))
55 4 4 unless ($ref)
56 0 4 if $value eq "true"
57 0 4 if $value eq "false"
59 3 1 if ($value =~ /\A(?:0|[1-9][0-9]*)(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\z/u or &looks_like_number($value))
66 1 3 if ($ref eq "ARRAY")
70 3 0 if ($ref eq "HASH")
83 0 1 unless @$array
88 0 1 unless $self->{'pretty'}
99 0 3 unless %$hash
102 0 3 unless $key =~ /\A[A-Za-z_][A-Za-z0-9_-]*\z/u
105 2 1 unless ref $val eq "ARRAY" and @$val > 0
108 0 1 unless ref $first eq "HASH" and %$first
112 0 3 unless $f =~ /\A[A-Za-z_][A-Za-z0-9_-]*\z/u
116 0 2 unless ref $row eq "HASH"
117 0 2 unless join(",", sort(keys %$row)) eq join(",", @fields)
119 0 6 unless defined $cell
120 0 6 if not &looks_like_number($cell) and $cell =~ /[,\n\r]/u
148 0 6 unless defined $value
149 2 4 if &looks_like_number($value)
154 0 3 unless %$hash
156 1 2 if ($level == 0 and $self->_is_tabular_encodable($hash))
161 2 0 if $self->{'canonical'}
164 3 0 $_ =~ /\A[A-Za-z_][A-Za-z0-9_-]*\z/u ? :
171 1 1 unless $self->{'pretty'}
196 0 17 unless defined $ch
198 3 14 if $ch eq "{"
199 3 11 if $ch eq "["
200 1 10 if $ch eq "\""
202 0 10 if ($self->_consume_literal($state, "null"))
203 1 9 if ($self->_consume_literal($state, "true"))
204 0 9 if ($self->_consume_literal($state, "false"))
206 8 1 if ($ch =~ /[-0-9]/u)
210 1 0 if ($ch =~ /[A-Za-z_]/u)
223 0 3 if (($self->_peek($state) // "") eq "}")
238 3 2 if (defined $ch and $ch eq ",")
256 0 3 if (($self->_peek($state) // "") eq "]")
266 4 3 if (defined $ch and $ch eq ",")
284 1 1 if $state->{'pos'} >= $state->{'len'}
287 0 1 unless defined $ch and $ch =~ /[A-Za-z_]/u
291 0 1 unless $remaining =~ /\A([A-Za-z_][A-Za-z0-9_-]*)/u
299 0 1 unless $remaining =~ /\A([0-9]+)/u
310 0 3 unless $remaining =~ /\A([A-Za-z_][A-Za-z0-9_-]*)/u
315 2 1 if (defined $c and $c eq ",")
333 2 0 if $c eq "\n"
339 2 4 unless $c eq " " or $c eq "\t"
345 4 2 if ($fi > 0)
347 0 4 unless defined $c and $c eq ","
369 2 4 if ($raw =~ /\A-?(?:0|[1-9][0-9]*)(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\z/u)
377 0 6 if defined $ch and $ch eq "\""
380 6 0 if ($remaining =~ /\A([A-Za-z_][A-Za-z0-9_-]*)/u)
396 1 3 if $ch eq "\""
398 0 3 if ($ch eq "\\")
400 0 0 if $state->{'pos'} >= $state->{'len'}
405 0 0 if ($esc eq '"') { }
0 0 elsif ($esc eq '\\') { }
0 0 elsif ($esc eq '/') { }
0 0 elsif ($esc eq 'n') { }
0 0 elsif ($esc eq 'r') { }
0 0 elsif ($esc eq 't') { }
0 0 elsif ($esc eq 'f') { }
0 0 elsif ($esc eq 'b') { }
0 0 elsif ($esc eq 'u') { }
415 0 0 unless $hex =~ /\A[0-9A-Fa-f]{4}\z/u
435 8 0 if ($remaining =~ /\A(-?(?:0|[1-9][0-9]*)(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?)/u)
444 28 1 unless substr($state->{'text'}, $state->{'pos'}, length $literal) eq $literal
447 0 1 if defined $next and $next =~ /[A-Za-z0-9_-]/u
455 1 22 unless defined $got and $got eq $char
460 0 72 if $state->{'pos'} >= $state->{'len'}
467 32 63 if ($ch =~ /[\x20\x09\x0A\x0D]/u)