Branch Coverage

blib/lib/IO/YAML.pm
Criterion Covered Total %
branch 68 114 59.6


line true false branch
20 9 3 unless defined $yaml_loader
21 4 8 if (UNIVERSAL::isa($args[0], 'GLOB')) { }
0 8 elsif (scalar @args >= 2 and $args[1] =~ /^\+?[<>rwa]|>>|\d+$/ and $args[0] ne 'mode') { }
26 3 1 if scalar(@args) % 2 and $args[0] =~ /^\+?[<>rwa]|>>|\d+$/
37 3 9 if (scalar(@args) % 2)
39 3 0 if (ref $args[0] eq '' or UNIVERSAL::can($args[0], 'stringify')) { }
61 9 12 scalar @_ > 1 ? :
62 22 11 scalar @_ > 1 ? :
63 5 27 scalar @_ > 1 ? :
64 1 8 scalar @_ > 1 ? :
66 21 0 scalar @_ > 1 ? :
67 0 30 scalar @_ > 1 ? :
68 22 103 scalar @_ > 1 ? :
73 0 1 unless defined $fh
76 0 1 if $mode =~ /^[r<]$/
78 0 1 unless print $fh "...\n"
86 0 9 if (defined $path and defined $fh)
92 0 9 if (defined $fh) { }
94 0 0 unless defined $mode
100 0 9 unless (defined $path)
102 0 0 if (exists &Errno::ENOENT) { }
118 0 9 unless ($fh->open($path, $mode))
138 13 0 if (defined $fh)
150 2 5 $self->auto_terminate ? :
162 22 9 scalar @$buffer ? :
163 0 31 unless defined $source
164 27 4 unless $source =~ /^#/
167 3 68 if ($line =~ /^\.\.\.$/) { }
22 46 elsif ($line =~ /^---/) { }
178 16 11 $self->auto_load ? :
190 0 0 if wantarray
202 0 3 if ($pos) { }
204 0 0 unless $result = fh_seek($fh, $pos, $whence)
207 0 0 if (not defined $source) { }
0 0 elsif (not $source =~ /^---(?=\s)/) { }
231 0 0 unless $! eq ''
238 0 0 unless $length == 0 or $length == $self->tell
254 0 12 if $self->handle
259 7 5 if $self->handle
260 12 0 unless ($^V and $^V lt '5.8.0')
261 12 0 if tied *$self
270 0 0 unless defined $f
280 0 9 if ($path =~ s/^(<|>|>>|\+<|\+>)\s*//)
283 4 5 unless defined $mode
296 0 5 unless $mode = $mode_norm{$mode}
306 4 8 if ($fh) { }
3 5 elsif (defined $path) { }
328 12 0 if ref $_[0]
335 1 27 if wantarray
393 13 0 if (UNIVERSAL::isa($fh, 'GLOB')) { }
405 3 0 if (UNIVERSAL::isa($fh, 'GLOB')) { }
417 3 0 if (UNIVERSAL::isa($fh, 'GLOB')) { }
429 0 0 if (UNIVERSAL::isa($fh, 'GLOB')) { }
441 3 0 if (UNIVERSAL::isa($fh, 'GLOB')) { }
463 13 5 unless $INC{$path}
464 0 9 unless my $L = $pkg->can('Load')
465 0 9 unless my $D = $pkg->can('Dump')