Branch Coverage

lib/Archive/Extract.pm
Criterion Covered Total %
branch 146 282 51.7


line true false branch
18 0 1 $^O eq 'solaris' ? :
19 0 1 $^O =~ /^(netbsd|minix)$/ ? :
20 0 1 $^O =~ /^(openbsd|bitrig)$/ ? :
21 0 1 $^O =~ /^(free|midnight|dragonfly)(bsd)?$/ ? :
22 1 0 $^O eq 'linux' ? :
23 68 0 -e $_[0] ? :
26 0 1 $^O eq 'VMS' ? :
29 0 1 $^O eq 'MSWin32' ? :
186 570 3667 if @_
269 0 68 unless my $parsed = check(\%utmpl, \%hash)
275 58 10 unless ($parsed->{'type'})
277 2 1 $ar =~ /.+?\.xz$/ ? :
8 3 $ar =~ /.+?\.(?:txz|tar\.xz)$/i ? :
2 11 $ar =~ /.+?\.lzma$/ ? :
2 13 $ar =~ /.+?\.Z$/ ? :
2 15 $ar =~ /.+?\.bz2$/i ? :
5 17 $ar =~ /.+?\.(?:tbz2?|tar\.bz2?)$/i ? :
22 22 $ar =~ /.+?\.(zip|jar|ear|war|par)$/i ? :
4 44 $ar =~ /.+?\.tar$/i ? :
2 48 $ar =~ /.+?\.gz$/i ? :
8 50 $ar =~ /.+?\.(?:tar\.gz|tgz)$/i ? :
296 1 67 unless $parsed->{'type'}
358 1 96 unless check($tmpl, \%hash)
367 16 80 if ($self->is_gz or $self->is_bz2 or $self->is_Z or $self->is_lzma or $self->is_xz) { }
372 0 16 if (-d $to) { }
389 38 58 unless (-d $dir)
392 0 38 if $@
403 0 96 unless (Archive::Extract::chdir($dir))
421 38 58 if $Archive::Extract::_ALLOW_PURE_PERL
422 58 38 if $Archive::Extract::_ALLOW_BIN
425 0 96 if $Archive::Extract::PREFER_BIN
434 96 0 if ($rv and $rv ne [()]) { }
0 0 elsif ($rv and $rv eq [()]) { }
450 0 96 unless ($self->_extractor)
451 0 0 $na ? :
0 0 $fail ? :
461 0 96 unless (Archive::Extract::chdir($cwd))
582 52 0 if $Archive::Extract::PROGRAMS->{'gzip'}
583 0 0 if $Archive::Extract::PROGRAMS->{'unzip'}
584 144 0 if $Archive::Extract::PROGRAMS->{'tar'}
585 34 0 if $Archive::Extract::PROGRAMS->{'bunzip2'}
587 4 0 if $Archive::Extract::PROGRAMS->{'uncompress'}
588 4 0 if $Archive::Extract::PROGRAMS->{'unlzma'}
589 52 0 if $Archive::Extract::PROGRAMS->{'unxz'}
604 0 3 unless $self->bin_bunzip2
632 1 2 unless $buffer
636 0 2 if $version < 1
666 0 48 $self->is_txz && !$self->bin_unxz ? :
0 48 $self->is_tbz && !$self->bin_bunzip2 ? :
0 48 $self->is_tgz && !$self->bin_gzip ? :
0 48 !$self->bin_tar ? :
676 0 48 if ($diag)
696 16 8 $self->is_txz ? :
8 24 $self->is_tbz ? :
16 32 $self->is_tgz ? :
717 0 48 unless ($out[0])
724 24 24 if (not 'IPC::Cmd'->can_capture_buffer || $buffer) { }
751 16 8 $self->is_txz ? :
8 24 $self->is_tbz ? :
16 32 $self->is_tgz ? :
761 0 48 unless (scalar run('command', $cmd, 'buffer', \$buffer, 'verbose', $Archive::Extract::DEBUG))
770 48 0 if ($self->files)
801 0 32 unless (can_load('modules', $use_list))
816 16 16 if ($self->is_tgz) { }
8 8 elsif ($self->is_tbz) { }
0 8 elsif ($self->is_txz) { }
821 16 0 if eval { do { 'Archive::Tar'->VERSION('0.99'); 1 } }
824 0 16 unless (can_load('modules', $use_list))
837 0 8 unless (can_load('modules', $use_list))
847 0 8 unless my $bz = 'IO::Uncompress::Bunzip2'->new($self->archive)
855 0 0 unless (can_load('modules', $use_list))
865 0 0 unless my $xz = 'IO::Uncompress::UnXz'->new($self->archive)
881 16 16 $self->is_tgz ? :
887 16 16 if ($Archive::Extract::_ALLOW_TAR_ITER and 'Archive::Tar'->can('iter')) { }
890 0 16 unless ($next = 'Archive::Tar'->iter(@read))
899 0 26 unless $file->extract
910 0 16 unless ($tar->read(@read))
929 0 16 unless $tar->extract
947 32 0 if -d $self->extract_path
964 0 2 unless ($self->bin_gzip)
969 0 2 unless my $fh = 'FileHandle'->new('>' . $self->_gunzip_to)
976 0 2 unless (scalar run('command', $cmd, 'verbose', $Archive::Extract::DEBUG, 'buffer', \$buffer))
985 1 0 unless ('IPC::Cmd'->can_capture_buffer or $buffer)
989 0 2 if defined $buffer
1004 0 4 unless (can_load('modules', $use_list))
1010 0 4 unless my $gz = &Compress::Zlib::gzopen($self->archive, 'rb')
1014 0 4 unless my $fh = 'FileHandle'->new('>' . $self->_gunzip_to)
1039 0 2 unless ($self->bin_uncompress)
1044 0 2 unless my $fh = 'FileHandle'->new('>' . $self->_gunzip_to)
1051 0 2 unless (scalar run('command', $cmd, 'verbose', $Archive::Extract::DEBUG, 'buffer', \$buffer))
1060 1 0 unless ('IPC::Cmd'->can_capture_buffer or $buffer)
1064 1 1 if defined $buffer
1087 0 0 unless ($self->bin_unzip)
1100 0 0 unless (scalar run('command', $cmd, 'verbose', $Archive::Extract::DEBUG, 'buffer', \$buffer))
1109 0 0 if (not 'IPC::Cmd'->can_capture_buffer || $buffer) { }
1125 0 0 unless (scalar run('command', $cmd, 'verbose', $Archive::Extract::DEBUG, 'buffer', \$buffer))
1133 0 0 if (scalar @{$self->files;})
1148 0 0 unless (can_load('modules', $use_list))
1156 0 0 unless ($zip->read($self->archive) == &Archive::Zip::AZ_OK)
1185 0 0 unless ($zip->extractMember($member, $to) == &Archive::Zip::AZ_OK)
1204 24 58 unless scalar @$files
1214 36 80 -d $files->[$pos] ? :
1226 58 0 if ($dir1 eq $dir2) { }
1235 0 0 $base1 eq $base2 ? :
1251 0 2 unless ($self->bin_bunzip2)
1256 0 2 unless my $fh = 'FileHandle'->new('>' . $self->_gunzip_to)
1262 0 2 if ($self->have_old_bunzip2 and not $self->archive =~ /\.bz2$/i)
1271 0 2 unless (scalar run('command', $cmd, 'verbose', $Archive::Extract::DEBUG, 'buffer', \$buffer))
1280 1 0 unless ('IPC::Cmd'->can_capture_buffer or $buffer)
1284 0 2 if defined $buffer
1331 0 2 unless (can_load('modules', $use_list))
1338 0 2 unless IO::Uncompress::Bunzip2::bunzip2($self->archive, $self->_gunzip_to)
1360 0 2 unless ($self->bin_unxz)
1365 0 2 unless my $fh = 'FileHandle'->new('>' . $self->_gunzip_to)
1372 0 2 unless (scalar run('command', $cmd, 'verbose', $Archive::Extract::DEBUG, 'buffer', \$buffer))
1381 1 0 unless ('IPC::Cmd'->can_capture_buffer or $buffer)
1385 0 2 if defined $buffer
1400 0 0 unless (can_load('modules', $use_list))
1407 0 0 unless IO::Uncompress::UnXz::unxz($self->archive, $self->_gunzip_to)
1430 0 2 unless ($self->bin_unlzma)
1435 0 2 unless my $fh = 'FileHandle'->new('>' . $self->_gunzip_to)
1442 0 2 unless (scalar run('command', $cmd, 'verbose', $Archive::Extract::DEBUG, 'buffer', \$buffer))
1451 1 0 unless ('IPC::Cmd'->can_capture_buffer or $buffer)
1455 0 2 if defined $buffer
1472 0 0 if (can_load('modules', $use_list1)) { }
0 0 elsif (can_load('modules', $use_list2)) { }
1473 0 0 unless IO::Uncompress::UnLzma::unlzma($self->archive, $self->_gunzip_to)
1480 0 0 unless my $fh = 'FileHandle'->new('>' . $self->_gunzip_to)
1486 0 0 unless (defined $buffer)
1491 0 0 if defined $buffer
1521 0 0 unless open my $file, '<', $unzip
1526 0 0 if (/[[:print:]]/)
1530 0 0 if ($buf and /[^[:print:]]/)
1531 0 0 if length $buf >= 4
1537 0 0 if $buf
1539 0 0 if ($part =~ /ZIPINFO/ or $part =~ /usage:.+?Z1/)
1571 1 34 if ($Archive::Extract::WARN)
1572 0 1 $Archive::Extract::DEBUG ? :
1601 192 0 unless $Archive::Extract::DEBUG
1608 0 24 unless my $file = shift()
1615 0 5 unless my $file = shift()