Branch Coverage

blib/lib/JSON/Streaming/Reader.pm
Criterion Covered Total %
branch 166 242 68.6


line true false branch
45 1 128 ref $value ? :
64 0 266 unless my $callback = $callbacks{$token_type}
72 96 867 if $$self{'errored'}
80 124 770 unless (defined $char)
82 8 116 unless $self->_state == {}
88 20 750 if $self->_state == {} and $$self{'used'}
90 135 615 if ($char eq ',' and not $self->done_comma)
91 89 46 if ($self->in_array or $self->in_object) { }
46 0 elsif ($self->in_property) { }
92 89 0 if ($self->made_value)
95 23 66 if ($self->is_event_based)
110 1 45 unless $self->made_value
117 94 521 if ($char ne '}' and $self->in_object)
120 0 88 unless $$name_token[0] eq ADD_STRING()
129 68 453 if ($char eq '{') { }
94 359 elsif ($char eq '}') { }
62 297 elsif ($char eq '[') { }
52 245 elsif ($char eq ']') { }
70 175 elsif ($char eq '"') { }
13 162 elsif ($char eq 't') { }
14 148 elsif ($char eq 'f') { }
16 132 elsif ($char eq 'n') { }
124 8 elsif ($char =~ /^[\d\-]/) { }
130 0 68 unless $self->can_start_value
137 0 94 if $self->done_comma
144 36 58 if ($self->in_property)
145 1 35 unless $self->made_value
151 3 55 unless $self->in_object
158 0 62 unless $self->can_start_value
165 2 50 unless $self->in_array
166 2 48 if $self->done_comma
173 1 69 unless $self->can_start_value
174 0 69 if $need_comma and not $self->done_comma
178 0 13 unless $self->can_start_value
179 0 13 if $need_comma and not $self->done_comma
187 0 14 unless $self->can_start_value
188 1 13 if $need_comma and not $self->done_comma
196 0 16 unless $self->can_start_value
197 0 16 if $need_comma and not $self->done_comma
205 0 124 unless $self->can_start_value
206 2 122 if $need_comma and not $self->done_comma
214 166 701 if ($@)
215 78 88 if (not ref $@ && $@ == {}) { }
236 0 0 if $self->is_event_based
240 0 0 if $self->in_property
241 0 0 if $self->in_object
242 0 0 if $self->in_array
249 0 0 unless defined $peek
251 0 0 if ($peek eq '"')
259 0 0 if ($start_chars < 1 and grep {$_ eq $peek;} @end_chars) { }
260 0 0 unless ($self->in_property and $peek eq '}')
265 0 0 if $skipped_value
269 0 0 if $peek eq '[' or $peek eq '{'
270 0 0 if $peek eq ']' or $peek eq '}'
280 0 6 if $self->is_event_based
299 8 8 if ($type eq ADD_STRING() or $type eq ADD_NUMBER()) { }
2 6 elsif ($type eq ADD_BOOLEAN()) { }
1 5 elsif ($type eq ADD_NULL()) { }
2 3 elsif ($type eq START_OBJECT()) { }
3 0 elsif ($type eq START_ARRAY()) { }
303 1 1 $$token[1] ? :
326 0 6 if ($self->in_array) { }
0 6 elsif ($self->in_object) { }
6 0 elsif ($self->in_property) { }
345 0 31 if ($type eq ERROR())
351 16 15 if ($item_type eq 'SCALAR' or $item_type eq 'REF') { }
11 4 elsif ($item_type eq 'ARRAY') { }
4 0 elsif ($item_type eq 'HASH') { }
354 8 8 if ($type eq END_PROPERTY()) { }
356 6 2 unless defined $current_item
363 3 8 if ($type eq END_ARRAY()) { }
365 0 3 unless defined $current_item
378 2 2 if ($type eq START_PROPERTY()) { }
2 0 elsif ($type eq END_OBJECT()) { }
385 0 2 unless defined $current_item
398 0 6 if defined $current_item
400 6 0 $need_deref ? :
406 0 65 unless $self->is_event_based
419 0 171 unless $self->is_event_based
439 0 208 unless my $callback = $$callbacks{$token_type}
447 88 83 if ($@) { }
449 88 0 if (ref $err and $err == {}) { }
463 0 83 unless my $callback = $$callbacks{'eof'}
480 14 724 unless (defined $char and $char eq $required)
481 9 5 defined $char ? :
489 3080 2743 if defined $$self{'peeked'}
494 314 2341 unless ($success)
508 124 1217 unless defined $char
509 855 362 unless $char =~ /^\s/
524 3 7 defined $self->_peek_char ? :
10 124 unless defined $accum and $accum ne ''
534 9 113 if ($self->_peek_char eq '-')
540 18 87 if (defined $self->_peek_char and $self->_peek_char eq '.')
547 10 88 if (defined $self->_peek_char and $self->_peek_char =~ /e/i)
552 4 5 if (defined $peek and $peek eq '+' || $peek eq '-')
587 4 944 unless defined $char
588 150 794 if ($char eq '"')
592 5 789 if ($char eq '\\') { }
595 0 5 unless defined $escape_char
597 4 1 if (my $replacement = $escape_chars{$escape_char}) { }
0 1 elsif ($escape_char eq 'u') { }
631 0 0 unless defined $char
632 0 0 if ($char eq '"')
636 0 0 if ($char eq '\\') { }
639 0 0 unless defined $escape_char
641 0 0 if (my $replacement = $escape_chars{$escape_char}) { }
0 0 elsif ($escape_char eq 'u') { }
642 0 0 if $want_result
653 0 0 if $want_result
663 0 213 if $self->_state == {} and $$self{'used'}
693 194 848 $_[0]->_state->{'in_object'} ? :
697 94 99 $_[0]->_state->{'in_array'} ? :
701 171 342 $_[0]->_state->{'in_property'} ? :
705 431 690 $_[0]->_state->{'made_value'} ? :
709 44 280 $_[0]->_state->{'done_comma'} ? :
713 337 123 unless $_[0]->_state == {}
714 337 123 unless $_[0]->_state == {}
719 89 0 unless $_[0]->_state == {}
724 1 366 if $_[0]->in_property and $_[0]->made_value
726 0 366 $_[0]->in_object ? :
730 0 0 $_[0]->in_object ? :