Branch Coverage

blib/lib/IO/Compress/Base.pm
Criterion Covered Total %
branch 181 234 77.3


line true false branch
42 32 164 if @_
91 96 6 if (defined *$self->{'FH'}) { }
93 0 96 if $here < 0
95 0 96 unless CORE::seek *$self->{'FH'}, $offset, 0
97 0 96 unless defined *$self->{'FH'}->write($data, length $data)
99 0 96 unless CORE::seek *$self->{'FH'}, $here, 0
123 4271 5147 if length $data == 0 and not $last
126 0 5147 if (*$self->{'FilterContainer'})
131 3343 1804 if (length $data)
132 1949 1394 if (defined *$self->{'FH'}) { }
133 0 1949 unless defined *$self->{'FH'}->write($data, length $data)
174 665 1375 *$self->{'OneShot'} ? :
25 2015 unless $got->parse({%PARAMS, $self->getExtraParams, *$self->{'OneShot'} ? $self->getOneShotParams : ()}, @_)
190 5 0 unless @_ or $got
196 1201 685 unless ($got)
199 0 1181 unless $got = $obj->checkParams($class, undef, @_)
207 0 1856 unless $obj->ckOutputParam($class, $outValue)
210 790 1066 if ($outType eq 'buffer') { }
224 81 1775 if ($merge)
227 12 42 if ($outType eq "buffer" and length $$outValue == 0 or $outType ne "buffer" and !(-e $outValue) || -w _ && -z _)
237 32 1824 unless $obj->ckParams($got)
240 20 1804 if ($got->getValue('encode')) { }
252 1750 69 if (not $merge) { }
254 0 1750 unless *$obj->{'Compress'} = $obj->mkComp($got)
260 727 1023 if ($outType eq 'buffer') { }
261 589 138 unless $appendOutput
265 197 826 if ($outType eq 'handle') { }
826 0 elsif ($outType eq 'filename') { }
270 53 144 if ($appendOutput)
272 0 53 unless CORE::seek *$obj->{'FH'}, 0, 2
280 58 768 if $appendOutput
282 5 821 unless *$obj->{'FH'} = "IO::File"->new("$mode $outValue")
291 0 1744 unless $obj->output(*$obj->{'Header'})
296 9 60 unless *$obj->{'Compress'} = $obj->createMerge($outValue, $outType)
316 5 1861 unless $outType
323 5 1856 if $outType eq "buffer" and &Scalar::Util::readonly(${$_[0];})
336 5 795 unless @_ >= 1
343 30 665 unless my $x = "IO::Compress::Base::Validator"->new($class, *$obj->{'Error'}, $name, $input, $output)
346 0 665 if $haveOut and $x->{'Hash'}
350 0 660 unless my $got = $obj->checkParams($name, undef, @_)
369 10 650 if ($x->{'GlobMap'})
375 0 20 unless $obj->_singleTarget($x, 1, $from, $to, @_)
382 75 575 unless ($x->{'oneOutput'})
387 45 30 $inFile ? :
389 35 40 $x->{'oneInput'} ? :
394 0 90 unless $obj->_singleTarget($x, $inFile, $in, \$out, @_)
420 610 75 if ($x->{'oneInput'}) { }
422 432 178 if isaScalar($input) or &isaFilename($input) and $inputIsFilename
425 5 605 unless my $z = $obj->_create($x->{'Got'}, @_)
429 0 605 unless defined $z->_wr2($input, $inputIsFilename)
445 105 75 if ($afterFirst++) { }
447 0 105 unless defined addInterStream($obj, $element, $isFilename)
452 75 0 if isaScalar($element) or $isFilename
455 0 75 unless $obj->_create($x->{'Got'}, @_)
459 0 180 unless defined $obj->_wr2($element, $isFilename)
477 30 755 unless ($inputIsFilename)
479 0 30 unless ref $source
483 248 537 if (ref $input and ref $input eq "SCALAR")
488 537 0 if (not ref $input or &isaFilehandle($input))
494 410 127 unless ($isFilehandle)
496 0 410 unless $fh = "IO::File"->new("<$input")
506 0 377 unless defined $self->syswrite($buff, @_)
510 0 537 unless defined $status
513 440 97 if (!$isFilehandle || *$self->{'AutoClose'} and $input ne "-")
515 0 440 unless $fh->close
532 60 45 if (*$self->{'Got'}->getValue('multistream')) { }
0 45 elsif (*$self->{'Got'}->getValue('autoflush')) { }
534 60 0 if isaScalar($input) or &isaFilename($input)
555 2006 0 if ref $_[0]
589 283 1822 if (ref $_[0]) { }
590 35 248 unless ref $_[0] eq "SCALAR"
598 85 1985 if (@_ > 1)
599 85 0 defined $$buffer ? :
602 10 75 if $_[1] < $len
604 40 45 if (@_ > 2)
606 5 35 if $offset > $slen
608 20 15 if ($offset < 0)
610 5 15 if $offset < 0
613 30 0 if $rem < $len
619 175 1885 if !defined($$buffer) || length $$buffer == 0 and not *$self->{'FlushPending'}
629 15 1870 if (*$self->{'Encoding'}) { }
634 1870 0 if $] >= "5.008"
639 1880 0 defined $$buffer ? :
647 0 1880 if $status == -1
651 0 1880 unless $self->outputPayload($outBuffer)
665 30 286 if (defined $\) { }
666 15 15 if (defined $,) { }
672 5 281 if (defined $,) { }
695 1 34 if $status == -1
697 25 9 if (defined *$self->{'FH'})
703 0 34 unless $self->outputPayload($outBuffer)
712 1 34 unless $self->_flushCompressed(@_)
715 25 9 if (defined *$self->{'FH'})
717 0 25 unless defined *$self->{'FH'}->flush
734 0 174 unless $self->_writeTrailer
737 0 174 unless $self->ckParams($got)
740 0 174 if ($got->getValue('encode')) { }
748 0 174 unless *$self->{'Compress'} = $self->mkComp($got)
753 0 174 unless $self->output(*$self->{'Header'})
767 0 174 unless my $got = $self->checkParams("newStream", *$self->{'Got'}, @_)
802 0 1978 if $status == -1
807 0 1978 unless defined $trailer
822 1938 1804 if *$self->{'Closed'} or not *$self->{'Compress'}
825 1804 0 if $] >= "5.008"
829 0 1804 unless $self->_writeTrailer
832 0 1804 unless $self->_writeFinalTrailer
835 0 1804 unless $self->output("", 1)
838 1053 751 if (defined *$self->{'FH'})
840 1003 50 if (!*$self->{'Handle'} || *$self->{'AutoClose'} and not *$self->{'StdIO'})
843 0 1003 unless *$self->{'FH'}->close
916 11 54 if ($whence == 0) { }
43 11 elsif ($whence == 1 or $whence == 2) { }
927 16 38 if $target == $here
930 11 27 if $target < $here
937 0 27 unless defined $self->syswrite("\0" x $offset)
957 25 5 defined *$self->{'FH'} ? :
970 10 10 defined *$self->{'FH'} ? :