Branch Coverage

blib/lib/Data/TOON/Decoder.pm
Criterion Covered Total %
branch 70 104 67.3


line true false branch
22 0 47 if @lines and $lines[-1] eq ""
40 0 234 if not defined $line or $line =~ /^\s*$/u
41 181 53 if $self->_get_depth($line) != 0
46 0 47 unless @non_empty
51 3 44 if ($first =~ /^\s*\[(\d+)([\t|]?)?\]\s*:\s*(.*)$/u)
54 1 2 $2 ? :
58 3 0 if ($rest)
69 0 0 if (not $line or $line =~ /^\s*$/u)
75 0 0 if ($depth == 0) { }
0 0 elsif ($depth > 0) { }
77 0 0 if ($line =~ /^\[/u)
84 0 0 if ($trimmed =~ /^-/u)
96 0 0 if @items
101 14 30 if ($first =~ /^\w+\[/u)
107 10 20 if (@non_empty == 1 and not $first =~ /:/u)
120 1 139 if ($target_depth > $self->{'max_depth'})
130 0 149 if (not $line or $line =~ /^\s*$/u)
138 0 149 if ($depth < $target_depth)
143 0 149 if ($depth > $target_depth + 1)
149 0 149 if ($depth > $target_depth)
164 147 2 if ($trimmed =~ /^(\w+)(\[[^\]]*\])?(\{[^}]*\})?\s*:\s*(.*)$/u)
168 13 134 if ($bracket) { }
106 28 elsif (not $rest or $rest =~ /^\s*$/u) { }
188 12 1 if ($bracket_part =~ /^\[(\d+)([\t|])?\]/u)
190 7 5 if (defined $2)
194 7 5 if ($fields_part) { }
204 0 14 if (not $line or $line =~ /^\s*$/u)
210 0 14 if ($depth <= 0)
217 0 14 if ($trimmed =~ /^-\s/u)
240 0 3 if (not $peek_line or $peek_line =~ /^\s*$/u)
246 0 3 if ($peek_depth <= 0)
253 3 0 if ($peek_trimmed =~ /^-/u)
262 3 2 if ($has_list_format) { }
268 0 7 if (not $line or $line =~ /^\s*$/u)
274 0 7 if ($depth <= 0)
281 7 0 if ($trimmed =~ /^-\s(.*)$/u) { }
286 4 3 if ($item_content =~ /^(\w+):\s*(.*)$/u) { }
291 0 4 if ($first_value =~ /^\s*$/u) { }
302 0 4 if (not $next_line or $next_line =~ /^\s*$/u)
308 2 2 if ($next_depth < $depth + 1 or $next_depth > $depth + 1)
315 0 2 if ($next_trimmed =~ /^-/u)
320 2 0 if ($next_trimmed =~ /^(\w+):\s*(.*)$/u) { }
353 0 90 unless defined $value
358 13 77 if ($value =~ /^"(.*)"$/u)
369 1 76 if $value eq "null"
370 2 74 if $value eq "true"
371 1 73 if $value eq "false"
374 30 43 if ($value =~ /^-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?$/u)
376 1 29 if ($value =~ /^[+-]?0\d/u and not $value =~ /^[+-]?0\./u)
385 2 27 if ($num == 0)
390 2 25 if ($num != int $num)
404 1 410 unless $line