Branch Coverage

blib/lib/YAML/Parser.pm
Criterion Covered Total %
branch 151 286 52.8


line true false branch
19 1 1 unless (defined $self->{'receiver'})
129 68 6492 if not ref $_[0]
138 0 6480 if isNull($value)
139 6462 18 if isBoolean($value)
140 12 6 if isNumber($value)
141 6 0 if isString($value)
142 0 0 if isFunction($value)
143 0 0 if isArray($value)
144 0 0 if isObject($value)
154 0 2752 if $@
162 80 2902 if ($o eq "\x{feff}")
165 104 2798 if (isFunction($o))
168 72 2726 if (isObject($o))
171 46 2680 if (isArray($o))
174 2630 50 if (isString($o))
191 0 3660 unless my $func = $self->can($name)
233 0 0 if (@_) { }
3399 0 2 unless my $m = $self->call([$self->func('auto_detect_indent'), $n], 'number')
3487 0 2 unless my $m = $self->call([$self->func('auto_detect_indent'), $n], 'number')
4040 0 2 if ($@)
4045 0 2 unless $ok
4047 0 2 if $self->{'pos'} < $self->{'end'}
4054 4 16522 unless $self->{'state'}[-1]
4090 0 6486 unless defined $curr
4100 516 5972 if isArray($func)
4102 2 6486 if isNumber($func) or isString($func)
4104 0 6486 unless isFunction($func)
4114 2 6484 if ($func->{'name'} eq 'l_bare_document')
4120 44 726 isFunction($_) ? :
4 770 isArray($_) ? :
4132 0 6486 if $type ne 'any' and typeof($value) ne $type
4136 24 6462 if ($type ne 'boolean') { }
4140 1906 4556 if ($value) { }
4159 12762 186 unless $receiver
4174 788 4972 if ($n =~ /^chr\((.)\)$/u) { }
4197 0 1074 unless defined $func
4200 612 462 unless ($self->call($func))
4215 322 1720 if ($self->call($func))
4235 0 274 if defined $max and $max < 0
4240 228 84 unless $self->call($func)
4241 4 80 if $self->{'pos'} == $pos
4245 216 0 if ($count >= $min and !defined($max) || $count <= $max)
4255 0 22 if defined $max and $max < 0
4260 12 36 unless $self->call($func)
4261 4 32 if $self->{'pos'} == $pos
4265 22 0 if ($count >= $min and !defined($max) || $count <= $max)
4278 0 72 unless defined $rule
4288 0 4 unless defined $value
4290 4 0 unless ref $value
4311 86 1554 if $self->the_end
4312 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)
4322 120 1434 if (substr($self->{'input'}, $self->{'pos'}, 1) eq $char)
4334 0 78 if $self->the_end
4335 76 2 if ($low le substr($self->{'input'}, $self->{'pos'}, 1) and substr($self->{'input'}, $self->{'pos'}, 1) le $high)
4350 2 174 if $self->the_end
4352 8 166 unless $self->call($funcs[0])
4356 24 226 if ($self->call($func))
4370 12 8 if $type eq '<='
4373 0 20 $type eq '!' ? :
4381 0 4 if $value == -1
4382 0 4 if $value eq 'auto-detect'
4385 4 0 if ($state->{'name'} ne 'all')
4388 0 44 if $i > $size - 2
4392 4 40 if $state->{'name'} eq 's_l_block_scalar'
4416 2 40 if isFunction($y)
4417 0 42 unless isNumber($y)
4437 0 18 if $i == 1
4449 6 0 unless isString($str)
4458 0 0 unless isString($str)
4466 10 0 unless isBoolean($test)
4467 4 6 if ($test)
4478 4 0 unless isNumber($x)
4479 0 4 unless isNumber($y)
4480 4 0 $x < $y ? :
4487 2 0 unless isNumber($x)
4488 0 2 unless isNumber($y)
4489 2 0 $x <= $y ? :
4515 564 2800 $self->{'pos'} == 0 || $self->{'pos'} >= $self->{'end'} || substr($self->{'input'}, $self->{'pos'} - 1, 1) eq "\n" ? :
4522 2 32 $self->{'pos'} >= $self->{'end'} ? :
4533 0 4 unless substr($self->{'input'}, $pos) =~ /^ ( (?: \ * (?:\#.*)? \n )* ) (\ *) /ux
4545 0 4 if ($in_seq and not length $pre) { }
4546 0 0 if $n == -1
4551 0 4 if $m < 0
4558 0 2 unless substr($self->{'input'}, $self->{'pos'}) =~ /^.*\n((?:\ *\n)*)(\ *)/u
4562 0 2 if $m < 1
4564 0 2 if $pre =~ /^.{$m}./mu
4578 0 0 if $ENV{'DEBUG'}
4611 0 0 if $call =~ /^($| |.* $)/u
4612 0 0 unless $self->{'trace_on'} or $call eq $self->trace_start
4616 0 0 if ($level > 0)
4622 0 0 if length $input > 30
4637 0 0 if ($ENV{'DEBUG'})
4645 0 0 if ($type eq '?' and not $self->{'trace_off'})
4648 0 0 if (grep(($_ eq $call), @{$self->trace_quiet;}))
4649 0 0 $type eq '?' ? :
4651 0 0 if ($type ne '?' and not $self->{'trace_off'})
4655 0 0 if (defined $trace_info)
4658 0 0 if ($prev_type eq '?' and $prev_level eq $level)
4660 0 0 if ($line =~ /^\d*\ *\+/u) { }
4667 0 0 if ($prev_level)
4675 0 0 if ($call eq $self->trace_start)
4682 0 0 unless @$args
4690 0 2 if (my $line = $self->{'trace_info'}[2])
4751 13 13 if (my $callback = $self->{'callback'}) { }
4761 38 6 if (defined $event->{'event'})
4762 0 38 if (my $anchor = $self->{'anchor'})
4765 0 38 if (my $tag = $self->{'tag'})
4775 52 22 if (@{$self->{'cache'};}) { }
4779 14 8 if ($event->{'event'} =~ /(mapping_start|sequence_start|scalar)/u)
4789 8 26 if $event
4794 0 6 unless my $events = pop @{$$self{'cache'};}
4796 2 4 if $event
4801 0 28 unless my $events = pop @{$$self{'cache'};}
4816 12 2 unless $self->{'document_start'}
4824 2 2 unless $self->{'document_end'}
4848 0 0 if defined $self->{'document_start'}{'version'}
4869 0 0 if defined $self->{'document_end'}
4920 0 0 length $2 ? :
4928 0 0 length $2 ? :
4938 0 0 length $2 ? :
4954 0 0 if $self->{'in_scalar'}
4969 0 2 if @$lines and $lines->[-1]{'text'} eq ''
4972 2 0 if ($t eq 'clip') { }
0 0 elsif ($t eq 'strip') { }
4988 0 46 if $self->{'in_scalar'}
4992 0 26 if $self->{'in_scalar'}
5020 0 0 if ($t eq 'clip') { }
0 0 elsif ($t eq 'strip') { }
5022 0 0 if $text eq "\n"
5052 0 0 if ($tag =~ /^!<(.*)>$/u) { }
0 0 elsif ($tag =~ /^!!(.*)/u) { }
0 0 elsif ($tag =~ /^(!.*?!)/u) { }
0 0 elsif (defined($prefix = $self->{'tag_map'}{'!'})) { }
5056 0 0 if (defined($prefix = $self->{'tag_map'}{'!!'})) { }
5065 0 0 if (defined $prefix) { }
5125 1 0 if $type eq '+DOC' and $_->{'explicit'}
5126 0 1 if $type eq '-DOC' and $_->{'explicit'}
5127 0 1 if $type eq '+MAP' and $_->{'flow'}
5128 1 0 if $type eq '+SEQ' and $_->{'flow'}
5129 0 13 if $_->{'anchor'}
5130 0 13 if $_->{'tag'}
5131 0 13 if $_->{'name'}
5132 5 8 if (exists $_->{'value'})