Branch Coverage

blib/lib/Chemistry/File.pm
Criterion Covered Total %
branch 33 60 55.0


line true false branch
159 0 0 if ($param eq ':auto') { }
164 0 0 if $@
168 0 0 if $@
182 0 0 if ($opts{'_must_override'})
199 0 3 if ($opts{'_must_override'})
274 0 9 if ($s) { }
9 0 elsif (not ref $file) { }
310 22 0 unless exists $$self{'opts'}{'fatal'}
419 1 3 unless defined $s and length $s
477 9 21 unless defined $file
478 4 17 if (ref $file eq 'SCALAR') { }
0 17 elsif (ref $file) { }
4 13 elsif ($$self{'opts'}{'gzip'} or not defined $$self{'opts'}{'gzip'} and $file =~ /.gz$/) { }
479 0 4 if $$self{'opts'}{'gzip'}
480 4 0 if ($] >= 5.008) { }
487 0 0 if $$self{'opts'}{'gzip'}
492 0 4 unless eval { do { require Compress::Zlib } }
498 2 2 unless ($mode eq '>')
499 0 2 unless my $gz = Compress::Zlib::gzopen($file, 'rb')
506 0 2 if ($Compress::Zlib::gzerrno != Compress::Zlib::Z_STREAM_END())
514 0 13 unless $fh = 'FileHandle'->new("$mode$file")
533 2 40 if ($fh and $self->mode eq '>' and $$self{'opts'}{'gzip'})
535 2 0 if $level == 1
537 0 2 if (ref $file) { }
541 0 2 unless my $gz = Compress::Zlib::gzopen($file, "wb$level")
545 0 508 unless $gz->gzwrite($_)
551 21 22 if ($self->mode)
552 0 21 unless $fh->close
21 0 if ($fh)
578 1 14 wantarray ? :