Branch Coverage

blib/lib/YAML/As/Parsed.pm
Criterion Covered Total %
branch 44 202 21.7


line true false branch
28 0 0 if (wantarray) { }
49 0 0 if (wantarray) { }
109 0 0 ref $_[0] ? :
112 0 0 unless my $file = shift()
113 0 0 unless -e $file
115 0 0 unless -f _
117 0 0 unless -r _
122 0 0 unless ($fh)
127 0 0 if (_can_flock())
128 0 0 unless flock $fh, 1
138 0 0 if (my $err = $@)
143 0 0 unless (close $fh)
151 0 3 ref $_[0] ? :
155 0 3 unless (defined $string)
161 0 3 if (utf8::is_utf8($string) and not utf8::valid($string))
175 0 3 unless length $string
182 0 3 if @lines and $lines[0] =~ /^\%YAML[: ][\d\.]+.*\z/
188 3 0 if ($lines[0] =~ /^---\s*(?:(.+)\s*)?\z/)
191 0 3 if (defined $1 and not $1 =~ /^(?:\#.+|\%YAML[: ][\d\.]+)\z/)
199 0 3 if (not @lines or $lines[0] =~ /^(?:---|\.\.\.)/) { }
0 3 elsif (not $in_document and @$self) { }
2 1 elsif ($lines[0] =~ /^\s*\-(?:\s|$|-+$)/) { }
1 0 elsif ($lines[0] =~ /^(\s*)\S/) { }
236 0 3 if (ref $err eq 'SCALAR') { }
0 3 elsif ($err) { }
247 0 0 unless length $string
254 0 0 unless length $string
257 0 0 length $1 > 1 ? :
268 7 23 if $string eq "~"
271 0 23 if ($string =~ /^$re_capture_single_quoted$re_trailing_comment\z/)
276 0 23 if ($string =~ /^$re_capture_double_quoted$re_trailing_comment\z/)
281 0 23 if ($string =~ /^[\'\"!&]/)
284 0 23 if $string =~ /^{}(?:\s+\#.*)?\z/
285 0 23 if $string =~ /^\[\](?:\s+\#.*)?\z/
288 23 0 unless ($string =~ /^[>|]/)
289 0 23 if $string =~ /^(?:-(?:\s|$)|[\@\%\`])/ or $string =~ /:(?:\s|$)/
297 0 0 unless @$lines
302 0 0 if (defined $indent->[-2] and $indent->[-1] <= $indent->[-2])
310 0 0 unless length $1 >= $indent->[-1]
314 0 0 substr($string, 0, 1) eq '>' ? :
315 0 0 substr($string, 1, 1) eq '-' ? :
324 0 8 if ($lines->[0] =~ /^(?:---|\.\.\.)/)
333 2 6 if (length $1 < $indent->[-1]) { }
0 6 elsif (length $1 > $indent->[-1]) { }
339 6 0 if ($lines->[0] =~ /^(\s*\-\s+)[^\'\"]\S*\s*:(?:\s+|$)/) { }
0 0 elsif ($lines->[0] =~ /^\s*\-\s*\z/) { }
0 0 elsif ($lines->[0] =~ /^\s*\-(\s*)(.+?)\s*\z/) { }
0 0 elsif (defined $indent->[-2] and $indent->[-1] == $indent->[-2]) { }
348 0 0 unless (@$lines)
352 0 0 if ($lines->[0] =~ /^(\s*)\-/) { }
0 0 elsif ($lines->[0] =~ /^(\s*)\S/) { }
354 0 0 if ($indent->[-1] == $indent2) { }
405 0 38 if ($lines->[0] =~ /^(?:---|\.\.\.)/)
414 4 34 if (length $1 < $indent->[-1]) { }
0 34 elsif (length $1 > $indent->[-1]) { }
424 0 34 if ($lines->[0] =~ s/^\s*$re_capture_single_quoted$re_key_value_separator//) { }
0 34 elsif ($lines->[0] =~ s/^\s*$re_capture_double_quoted$re_key_value_separator//) { }
34 0 elsif ($lines->[0] =~ s/^\s*$re_capture_unquoted_key$re_key_value_separator//) { }
0 0 elsif ($lines->[0] =~ /^\s*\?/) { }
447 0 34 if (exists $hash->{$key})
452 30 4 if (length $lines->[0]) { }
460 0 4 unless (@$lines)
464 2 2 if ($lines->[0] =~ /^(\s*)-/) { }
2 0 elsif ($lines->[0] =~ /^(\s*)./) { }
471 0 2 if ($indent->[-1] >= $indent2) { }
495 0 0 unless my $file = shift()
499 0 0 if (_can_flock()) { }
502 0 0 unless sysopen $fh, $file, $flags
508 0 0 unless flock $fh, 2
523 0 0 unless (close $fh)
532 0 0 unless ref $self and @$self
543 0 0 if (not defined $cursor) { }
0 0 elsif (not ref $cursor) { }
0 0 elsif (ref $cursor eq 'ARRAY') { }
0 0 elsif (ref $cursor eq 'HASH') { }
552 0 0 unless (@$cursor)
560 0 0 unless (%$cursor)
571 0 0 if (ref $@ eq 'SCALAR') { }
0 0 elsif ($@) { }
591 0 0 unless defined $string
592 0 0 unless length $string
593 0 0 if (&Scalar::Util::looks_like_number($string))
595 0 0 if ($is_key or $has_string_flag) { }
602 0 0 if ($string =~ /[\x00-\x09\x0b-\x0d\x0e-\x1f\x7f-\x9f\'\n]/)
611 0 0 if ($string =~ /(?:^[~!\@#%&*|>?:,'"`{}\[\]]|^-+$|\s|:\z)/ or $QUOTE{$string})
621 0 0 if ($$seen{&refaddr($array)}++)
628 0 0 if (not $type) { }
0 0 elsif ($type eq 'ARRAY') { }
0 0 elsif ($type eq 'HASH') { }
633 0 0 if (@$el) { }
642 0 0 if (keys %$el) { }
660 0 0 if ($$seen{&refaddr($hash)}++)
668 0 0 if (not $type) { }
0 0 elsif ($type eq 'ARRAY') { }
0 0 elsif ($type eq 'HASH') { }
673 0 0 if (@$el) { }
682 0 0 if (keys %$el) { }
710 0 0 unless $errstr_warned++
719 0 0 if (defined $HAS_FLOCK) { }
726 0 0 if $HAS_FLOCK
734 2 0 if (eval { do { 'Scalar::Util'->VERSION(1.18) } }) { }