Branch Coverage

blib/lib/JQ/Lite/Parser.pm
Criterion Covered Total %
branch 57 78 73.0


line true false branch
12 0 936 unless defined $query
13 0 936 if $query =~ /^\s*\.\s*$/
23 14 1379 if ($_ eq '.[]') { }
549 830 elsif ($_ =~ /^\.(.+)$/) { }
28 5 544 if ($rest =~ /,/) { }
4 540 elsif ($rest =~ /^\s*\[/) { }
49 491 elsif ($rest =~ m[^\s*[+\-*/%]] or $rest =~ m[[+\-*/%]] or $rest =~ /(?:==|!=|>=|<=|>|<|\band\b|\bor\b)/i or $rest =~ /\b(?:floor|ceil|round|tonumber)\b/) { }
44 2 489 if ($trimmed =~ /^"(?:[^"\\]|\\.)*"$/s)
46 2 0 if defined $decoded and not $@
60 0 1391 unless defined $part
65 4 1387 if ($trimmed =~ /^\(.*\)$/s)
67 3 1 if (defined $inner and length $inner and $inner ne $trimmed)
69 3 0 if (@inner_parts)
85 0 1424 unless defined $text
86 1396 28 if index($text, "{") == -1
97 32 234 if (defined $string)
99 0 32 if ($escape) { }
0 32 elsif ($char eq '\\') { }
4 28 elsif ($char eq $string) { }
112 4 230 if ($char eq "'" or $char eq "\"")
119 28 202 if ($char eq "{")
121 28 0 if (defined $body)
147 200 366 if (defined $string)
148 0 200 if ($escape)
153 0 200 if ($char eq "\\")
158 37 163 if ($char eq $string)
165 37 329 if ($char eq "'" or $char eq "\"")
170 32 297 if ($char eq "{")
175 32 265 if ($char eq "}")
177 28 4 if ($depth == 0)
191 0 28 unless defined $inner
194 0 28 unless @parts
198 0 37 unless defined $part
202 1 36 if $trimmed eq ""
206 33 3 if (defined $lhs and defined $rhs)
217 3 0 if (not defined $lhs and $trimmed =~ /^[A-Za-z_][A-Za-z0-9_]*$/)
222 0 0 if (defined $lhs and not defined $rhs)
225 0 0 if $key eq ""
232 0 0 if length $lowered