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 124 6 if (defined *$self->{'FH'}) { }
93 0 124 if $here < 0
95 0 124 unless CORE::seek *$self->{'FH'}, $offset, 0
97 0 124 unless defined *$self->{'FH'}->write($data, length $data)
99 0 124 unless CORE::seek *$self->{'FH'}, $here, 0
123 4311 5268 if length $data == 0 and not $last
126 0 5268 if (*$self->{'FilterContainer'})
131 3433 1835 if (length $data)
132 2039 1394 if (defined *$self->{'FH'}) { }
133 0 2039 unless defined *$self->{'FH'}->write($data, length $data)
174 695 1376 *$self->{'OneShot'} ? :
25 2046 unless $got->parse({%PARAMS, $self->getExtraParams, *$self->{'OneShot'} ? $self->getOneShotParams : ()}, @_)
190 5 0 unless @_ or $got
196 1202 715 unless ($got)
199 0 1182 unless $got = $obj->checkParams($class, undef, @_)
207 0 1887 unless $obj->ckOutputParam($class, $outValue)
210 790 1097 if ($outType eq 'buffer') { }
224 81 1806 if ($merge)
227 12 42 if ($outType eq "buffer" and length $$outValue == 0 or $outType ne "buffer" and !(-e $outValue) || -w _ && -z _)
237 32 1855 unless $obj->ckParams($got)
240 20 1835 if ($got->getValue('encode')) { }
252 1781 69 if (not $merge) { }
254 0 1781 unless *$obj->{'Compress'} = $obj->mkComp($got)
260 727 1054 if ($outType eq 'buffer') { }
261 589 138 unless $appendOutput
265 214 840 if ($outType eq 'handle') { }
840 0 elsif ($outType eq 'filename') { }
270 53 161 if ($appendOutput)
272 0 53 unless CORE::seek *$obj->{'FH'}, 0, 2
280 58 782 if $appendOutput
282 5 835 unless *$obj->{'FH'} = "IO::File"->new("$mode $outValue")
291 0 1775 unless $obj->output(*$obj->{'Header'})
296 9 60 unless *$obj->{'Compress'} = $obj->createMerge($outValue, $outType)
316 5 1892 unless $outType
323 5 1887 if $outType eq "buffer" and &Scalar::Util::readonly(${$_[0];})
336 5 825 unless @_ >= 1
343 30 695 unless my $x = "IO::Compress::Base::Validator"->new($class, *$obj->{'Error'}, $name, $input, $output)
346 0 695 if $haveOut and $x->{'Hash'}
350 0 690 unless my $got = $obj->checkParams($name, undef, @_)
369 10 680 if ($x->{'GlobMap'})
375 0 20 unless $obj->_singleTarget($x, 1, $from, $to, @_)
382 75 605 unless ($x->{'oneOutput'})
387 45 30 $inFile ? :
389 35 40 $x->{'oneInput'} ? :
394 0 90 unless $obj->_singleTarget($x, $inFile, $in, \$out, @_)
420 640 75 if ($x->{'oneInput'}) { }
422 432 208 if isaScalar($input) or &isaFilename($input) and $inputIsFilename
425 5 635 unless my $z = $obj->_create($x->{'Got'}, @_)
429 0 635 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 785 unless ($inputIsFilename)
479 0 30 unless ref $source
483 248 567 if (ref $input and ref $input eq "SCALAR")
488 567 0 if (not ref $input or &isaFilehandle($input))
494 410 157 unless ($isFilehandle)
496 0 410 unless $fh = "IO::File"->new("<$input")
506 0 407 unless defined $self->syswrite($buff, @_)
510 0 567 unless defined $status
513 440 127 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 2037 0 if ref $_[0]
589 283 1859 if (ref $_[0]) { }
590 35 248 unless ref $_[0] eq "SCALAR"
598 85 2022 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 1922 if !defined($$buffer) || length $$buffer == 0 and not *$self->{'FlushPending'}
629 15 1907 if (*$self->{'Encoding'}) { }
634 1907 0 if $] >= "5.008"
639 1917 0 defined $$buffer ? :
647 0 1917 if $status == -1
651 0 1917 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 2009 if $status == -1
807 0 2009 unless defined $trailer
822 1969 1835 if *$self->{'Closed'} or not *$self->{'Compress'}
825 1835 0 if $] >= "5.008"
829 0 1835 unless $self->_writeTrailer
832 0 1835 unless $self->_writeFinalTrailer
835 0 1835 unless $self->output("", 1)
838 1084 751 if (defined *$self->{'FH'})
840 1018 66 if (!*$self->{'Handle'} || *$self->{'AutoClose'} and not *$self->{'StdIO'})
843 0 1018 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'} ? :