Branch Coverage

blib/lib/Tiny/YAML.pm
Criterion Covered Total %
branch 25 86 29.0


line true false branch
20 6 0 wantarray ? :
26 0 0 wantarray ? :
103 0 0 unless my $file = shift()
104 0 0 unless -e $file
106 0 0 unless -f _
108 0 0 unless -r _
113 0 0 unless ($fh)
123 0 0 if (my $err = $@)
128 0 0 unless (close $fh)
139 0 6 unless (defined $string)
145 0 6 if (utf8::is_utf8($string) and not utf8::valid($string))
164 0 0 if (ref $@ eq 'SCALAR') { }
0 0 elsif ($@) { }
198 0 0 unless my $file = shift()
207 0 0 unless (close $fh)
217 0 6 unless ref $self and @$self
228 0 6 if (not defined $cursor) { }
0 6 elsif (not ref $cursor) { }
0 6 elsif (ref $cursor eq 'ARRAY') { }
6 0 elsif (ref $cursor eq 'HASH') { }
237 0 0 unless (@$cursor)
245 0 6 unless (%$cursor)
256 0 6 if (ref $@ eq 'SCALAR') { }
0 6 elsif ($@) { }
276 0 16 unless defined $string
277 0 16 unless length $string
278 2 14 if (&Scalar::Util::looks_like_number($string))
280 2 0 if ($is_key or $has_string_flag) { }
287 0 14 if ($string =~ /[\x00-\x09\x0b-\x0d\x0e-\x1f\x7f-\x9f\'\n]/)
296 0 14 if ($string =~ /(?:^[~!\@#%&*|>?:,'"`{}\[\]]|^-+$|\s|:\z)/ or $QUOTE{$string})
306 0 0 if ($$seen{&refaddr($array)}++)
313 0 0 if (not $type) { }
0 0 elsif ($type eq 'ARRAY') { }
0 0 elsif ($type eq 'HASH') { }
318 0 0 if (@$el) { }
327 0 0 if (keys %$el) { }
345 0 8 if ($$seen{&refaddr($hash)}++)
353 7 2 if (not $type) { }
0 2 elsif ($type eq 'ARRAY') { }
2 0 elsif ($type eq 'HASH') { }
358 0 0 if (@$el) { }
367 2 0 if (keys %$el) { }
400 2 0 if (eval { do { require Scalar::Util; 'Scalar::Util'->VERSION(1.18) } }) { }