Branch Coverage

blib/lib/YAML/Parser.pm
Criterion Covered Total %
branch 152 288 52.7


line true false branch
19 1 1 unless (defined $self->{'receiver'})
130 68 6490 if not ref $_[0]
139 0 6478 if isNull($value)
140 6460 18 if isBoolean($value)
141 12 6 if isNumber($value)
142 6 0 if isString($value)
143 0 0 if isFunction($value)
144 0 0 if isArray($value)
145 0 0 if isObject($value)
155 0 2752 if $@
163 80 2902 if ($o eq "\x{feff}")
166 104 2798 if (isFunction($o))
169 72 2726 if (isObject($o))
172 46 2680 if (isArray($o))
175 2630 50 if (isString($o))
192 0 3658 unless my $func = $self->can($name)
234 0 0 if (@_) { }
3400 0 2 unless my $m = $self->call([$self->func("auto_detect_indent"), $n], "number")
3488 0 2 unless my $m = $self->call([$self->func("auto_detect_indent"), $n], "number")
4032 2 0 unless &Encode::is_utf8($input)
4045 0 2 if ($@)
4050 0 2 unless $ok
4052 0 2 if $self->{'pos'} < $self->{'end'}
4059 4 16518 unless $self->{'state'}[-1]
4095 0 6484 unless defined $curr
4105 516 5970 if isArray($func)
4107 2 6484 if isNumber($func) or isString($func)
4109 0 6484 unless isFunction($func)
4119 2 6482 if ($func->{'name'} eq "l_bare_document")
4125 44 726 isFunction($_) ? :
4 770 isArray($_) ? :
4137 0 6484 if $type ne "any" and typeof($value) ne $type
4141 24 6460 if ($type ne 'boolean') { }
4145 1906 4554 if ($value) { }
4164 12758 186 unless $receiver
4179 788 4976 if ($n =~ /^chr\((.)\)$/u) { }
4202 0 1074 unless defined $func
4205 612 462 unless ($self->call($func))
4220 322 1720 if ($self->call($func))
4240 0 274 if defined $max and $max < 0
4245 228 84 unless $self->call($func)
4246 4 80 if $self->{'pos'} == $pos
4250 216 0 if ($count >= $min and !defined($max) || $count <= $max)
4260 0 22 if defined $max and $max < 0
4265 12 36 unless $self->call($func)
4266 4 32 if $self->{'pos'} == $pos
4270 22 0 if ($count >= $min and !defined($max) || $count <= $max)
4283 0 72 unless defined $rule
4293 0 4 unless defined $value
4295 4 0 unless ref $value
4316 86 1554 if $self->the_end
4317 0 1522 if ($self->{'pos'} >= $self->{'end'} or $self->state_curr->{'doc'} and $self->start_of_line and substr($self->{'input'}, $self->{'pos'}) =~ /^(?:---|\.\.\.)(?=\s|\z)/u)
4327 120 1434 if (substr($self->{'input'}, $self->{'pos'}, 1) eq $char)
4339 0 78 if $self->the_end
4340 76 2 if ($low le substr($self->{'input'}, $self->{'pos'}, 1) and substr($self->{'input'}, $self->{'pos'}, 1) le $high)
4355 2 174 if $self->the_end
4357 8 166 unless $self->call($funcs[0])
4361 24 226 if ($self->call($func))
4375 12 8 if $type eq "<="
4378 0 20 $type eq '!' ? :
4386 0 4 if $value == -1
4387 0 4 if $value eq "auto-detect"
4390 4 0 if ($state->{'name'} ne "all")
4393 0 44 if $i > $size - 2
4397 4 40 if $state->{'name'} eq "s_l_block_scalar"
4421 2 40 if isFunction($y)
4422 0 42 unless isNumber($y)
4442 0 18 if $i == 1
4454 6 0 unless isString($str)
4463 0 0 unless isString($str)
4471 10 0 unless isBoolean($test)
4472 4 6 if ($test)
4483 4 0 unless isNumber($x)
4484 0 4 unless isNumber($y)
4485 4 0 $x < $y ? :
4492 2 0 unless isNumber($x)
4493 0 2 unless isNumber($y)
4494 2 0 $x <= $y ? :
4520 564 2800 $self->{'pos'} == 0 || $self->{'pos'} >= $self->{'end'} || substr($self->{'input'}, $self->{'pos'} - 1, 1) eq "\n" ? :
4527 2 32 $self->{'pos'} >= $self->{'end'} ? :
4538 0 4 unless substr($self->{'input'}, $pos) =~ /^ ( (?: \ * (?:\#.*)? \n )* ) (\ *) /ux
4550 0 4 if ($in_seq and not length $pre) { }
4551 0 0 if $n == -1
4556 0 4 if $m < 0
4563 0 2 unless substr($self->{'input'}, $self->{'pos'}) =~ /^.*\n((?:\ *\n)*)(\ *)/u
4567 0 2 if $m < 1
4569 0 2 if $pre =~ /^.{$m}./mu
4583 0 0 if $ENV{'DEBUG'}
4616 0 0 if $call =~ /^($| |.* $)/u
4617 0 0 unless $self->{'trace_on'} or $call eq $self->trace_start
4621 0 0 if ($level > 0)
4627 0 0 if length $input > 30
4642 0 0 if ($ENV{'DEBUG'})
4650 0 0 if ($type eq "?" and not $self->{'trace_off'})
4653 0 0 if (grep(($_ eq $call), @{$self->trace_quiet;}))
4654 0 0 $type eq '?' ? :
4656 0 0 if ($type ne "?" and not $self->{'trace_off'})
4660 0 0 if (defined $trace_info)
4663 0 0 if ($prev_type eq "?" and $prev_level eq $level)
4665 0 0 if ($line =~ /^\d*\ *\+/u) { }
4672 0 0 if ($prev_level)
4680 0 0 if ($call eq $self->trace_start)
4687 0 0 unless @$args
4695 0 2 if (my $line = $self->{'trace_info'}[2])
4756 13 13 if (my $callback = $self->{'callback'}) { }
4766 38 6 if (defined $event->{'event'})
4767 0 38 if (my $anchor = $self->{'anchor'})
4770 0 38 if (my $tag = $self->{'tag'})
4780 52 22 if (@{$self->{'cache'};}) { }
4784 14 8 if ($event->{'event'} =~ /(mapping_start|sequence_start|scalar)/u)
4794 8 26 if $event
4799 0 6 unless my $events = pop @{$$self{"cache"};}
4801 2 4 if $event
4806 0 28 unless my $events = pop @{$$self{"cache"};}
4821 12 2 unless $self->{'document_start'}
4829 2 2 unless $self->{'document_end'}
4853 0 0 if defined $self->{'document_start'}{'version'}
4874 0 0 if defined $self->{'document_end'}
4925 0 0 length $2 ? :
4933 0 0 length $2 ? :
4943 0 0 length $2 ? :
4960 0 0 if $self->{'in_scalar'}
4975 0 2 if @$lines and $lines->[-1]{'text'} eq ""
4978 2 0 if ($t eq 'clip') { }
0 0 elsif ($t eq 'strip') { }
4994 0 46 if $self->{'in_scalar'}
4998 0 26 if $self->{'in_scalar'}
5026 0 0 if ($t eq 'clip') { }
0 0 elsif ($t eq 'strip') { }
5028 0 0 if $text eq "\n"
5058 0 0 if ($tag =~ /^!<(.*)>$/u) { }
0 0 elsif ($tag =~ /^!!(.*)/u) { }
0 0 elsif ($tag =~ /^(!.*?!)/u) { }
0 0 elsif (defined($prefix = $self->{'tag_map'}{'!'})) { }
5062 0 0 if (defined($prefix = $self->{'tag_map'}{'!!'})) { }
5071 0 0 if (defined $prefix) { }
5131 1 0 if $type eq "+DOC" and $_->{'explicit'}
5132 0 1 if $type eq "-DOC" and $_->{'explicit'}
5133 0 1 if $type eq "+MAP" and $_->{'flow'}
5134 1 0 if $type eq "+SEQ" and $_->{'flow'}
5135 0 13 if $_->{'anchor'}
5136 0 13 if $_->{'tag'}
5137 0 13 if $_->{'name'}
5138 5 8 if (exists $_->{'value'})