Branch Coverage

blib/lib/JSON/Repair.pm
Criterion Covered Total %
branch 45 106 42.4


line true false branch
35 9 16 unless ($@)
42 13 3 if ($error eq 'Unexpected character') { }
2 1 elsif ($error eq 'Unexpected end of input') { }
1 0 elsif ($error eq 'Empty input') { }
50 0 13 if ($verbose)
57 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)
115 0 2 if ($bad_char eq '#')
116 0 0 if ($verbose)
119 0 0 if ($remaining =~ s/^(.*)\n//u)
120 0 0 if ($verbose)
127 1 1 if ($type eq 'initial state' and not $previous =~ /^\s+$/u)
128 0 1 if ($verbose)
135 0 1 if ($type eq 'object' || $type eq 'array' and $valid_bytes->[44])
137 0 0 if ($verbose)
143 0 0 if ($previous =~ s/(\s+)$//u)
150 0 0 if ($type eq 'object' and $valid_bytes->[34])
151 0 0 if ($verbose)
154 0 0 if ($remaining =~ s/(^[^\}\]:,\n\r"]*)(\s*):/$1"$2:/u)
155 0 0 if ($verbose)
161 0 0 if ($previous =~ /:\s*$/u)
163 0 0 if ($remaining =~ s/^(.*)\n/"$1"\n/u)
164 0 0 if ($verbose)
172 4 3 if ($type eq 'string')
173 4 0 if ($bad_byte < 32)
175 0 4 if ($verbose)
183 1 2 if ($bad_char eq '.' and $remaining =~ /^[0-9]+/u)
188 2 0 if ($type eq 'number')
189 1 1 if ($previous =~ /0$/u and $remaining =~ /^[0-9]+/u)
190 0 1 if ($verbose)
199 1 0 if ($bad_char =~ /[eE]/u and $previous =~ /\.$/u)
200 0 1 if ($verbose)
209 0 0 if ($verbose)
218 0 2 if ($type eq 'string') { }
1 1 elsif ($type eq 'object') { }
1 0 elsif ($type eq 'array') { }
220 0 0 if ($verbose)
227 0 1 if ($verbose)
234 0 1 if ($verbose)
249 0 1 if ($verbose)
254 0 0 if ($verbose)
268 0 0 if ($ok)