Branch Coverage

blib/lib/JSON/Repair.pm
Criterion Covered Total %
branch 46 116 39.6


line true false branch
36 9 16 unless ($@)
43 13 3 if ($error eq 'Unexpected character') { }
2 1 elsif ($error eq 'Unexpected end of input') { }
1 0 elsif ($error eq 'Empty input') { }
51 0 13 if ($verbose)
58 3 10 if ($bad_char eq q['] and $valid_bytes->[34]) { }
2 8 elsif ($bad_char eq '}' or $bad_char eq ']') { }
61 3 0 if ($remaining =~ s/^([^,:\]\}]*)'(\s*[,:\]\}])/$1"$2/u)
63 1 2 if ($string =~ /"/u)
70 0 3 if ($verbose)
80 2 0 if ($previous =~ /,\s*$/u) { }
0 0 elsif ($bad_char eq '}' and $previous =~ /:\s*$/u) { }
83 0 2 if ($verbose)
99 2 6 if ($type eq 'object' or $type eq 'array' or $type eq 'initial state')
102 0 2 if ($bad_char eq '/')
103 0 0 if ($verbose)
107 0 0 if ($remaining =~ s/^($JSON::Repair::comment_re)//u)
108 0 0 if ($verbose)
116 0 2 if ($bad_char eq '#')
117 0 0 if ($verbose)
120 0 0 if ($remaining =~ s/^(.*)\n//u)
121 0 0 if ($verbose)
129 1 1 if ($type eq 'initial state' and not $previous =~ /^\s+$/u)
130 0 1 if ($verbose)
137 0 1 if ($type eq 'object' || $type eq 'array' and $valid_bytes->[44])
139 0 0 if ($verbose)
145 0 0 if ($previous =~ s/(\s+)$//u)
152 0 0 if ($type eq 'object' and $valid_bytes->[34])
153 0 0 if ($verbose)
156 0 0 if ($remaining =~ s/(^[^\}\]:,\n\r"]*)(\s*):/$1"$2:/u)
157 0 0 if ($verbose)
163 0 0 if ($output =~ s/(\s+)"[:,]/"$1:/gu)
164 0 0 if ($verbose)
170 0 0 if ($previous =~ /:\s*$/u)
172 0 0 if ($remaining =~ s/^(.*)\n/"$1"\n/u)
173 0 0 if ($verbose)
181 4 3 if ($type eq 'string')
182 4 0 if ($bad_byte < 32)
184 0 4 if ($verbose)
193 1 2 if ($bad_char eq '.' and $remaining =~ /^[0-9]+/u)
194 0 1 if ($verbose)
201 2 0 if ($type eq 'number')
202 1 1 if ($previous =~ /0$/u and $remaining =~ /^[0-9]+/u)
203 0 1 if ($verbose)
212 1 0 if ($bad_char =~ /[eE]/u and $previous =~ /\.$/u)
213 0 1 if ($verbose)
222 0 0 if ($verbose)
231 0 2 if ($type eq 'string') { }
1 1 elsif ($type eq 'object') { }
1 0 elsif ($type eq 'array') { }
233 0 0 if ($verbose)
240 0 1 if ($verbose)
247 0 1 if ($verbose)
262 0 1 if ($verbose)
267 0 0 if ($verbose)
281 0 0 if ($ok)
306 0 0 if ($previous =~ s/\h+$//u)
307 0 0 if ($verbose)