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 ']') { }
60 3 0 if ($remaining =~ s/^([^,:\]\}]*)'(\s*[,:\]\}])/$1"$2/u)
62 1 2 if ($string =~ /"/u)
69 0 3 if ($verbose)
79 2 0 if ($previous =~ /,\s*$/u) { }
0 0 elsif ($bad_char eq '}' and $previous =~ /:\s*$/u) { }
82 0 2 if ($verbose)
98 2 6 if ($type eq 'object' or $type eq 'array' or $type eq 'initial state')
101 0 2 if ($bad_char eq '/')
102 0 0 if ($verbose)
106 0 0 if ($remaining =~ s/^($JSON::Repair::comment_re)//u)
107 0 0 if ($verbose)
114 0 2 if ($bad_char eq '#')
115 0 0 if ($verbose)
118 0 0 if ($remaining =~ s/^(.*)\n//u)
119 0 0 if ($verbose)
126 1 1 if ($type eq 'initial state' and not $previous =~ /^\s+$/u)
127 0 1 if ($verbose)
134 0 1 if ($type eq 'object' || $type eq 'array' and $valid_bytes->[44])
136 0 0 if ($verbose)
142 0 0 if ($previous =~ s/(\s+)$//u)
149 0 0 if ($type eq 'object' and $valid_bytes->[34])
150 0 0 if ($verbose)
153 0 0 if ($remaining =~ s/(^[^\}\]:,\n\r"]*)(\s*):/$1"$2:/u)
154 0 0 if ($verbose)
160 0 0 if ($previous =~ /:\s*$/u)
162 0 0 if ($remaining =~ s/^(.*)\n/"$1"\n/u)
163 0 0 if ($verbose)
171 4 3 if ($type eq 'string')
172 4 0 if ($bad_byte < 32)
174 0 4 if ($verbose)
182 1 2 if ($bad_char eq '.' and $remaining =~ /^[0-9]+/u)
187 2 0 if ($type eq 'number')
188 1 1 if ($previous =~ /0$/u and $remaining =~ /^[0-9]+/u)
189 0 1 if ($verbose)
198 1 0 if ($bad_char =~ /[eE]/u and $previous =~ /\.$/u)
199 0 1 if ($verbose)
208 0 0 if ($verbose)
217 0 2 if ($type eq 'string') { }
1 1 elsif ($type eq 'object') { }
1 0 elsif ($type eq 'array') { }
219 0 0 if ($verbose)
226 0 1 if ($verbose)
233 0 1 if ($verbose)
248 0 1 if ($verbose)
253 0 0 if ($verbose)
267 0 0 if ($ok)