Branch Coverage

lib/CPANPLUS/Internals/Utils.pm
Criterion Covered Total %
branch 60 104 57.6


line true false branch
64 0 17 unless my $args = check($tmpl, \%hash)
68 0 17 unless (can_load("modules", {"File::Path", 0}))
75 0 17 if ($@)
102 1 65 unless my $args = check($tmpl, \%hash)
104 0 65 unless (CPANPLUS::Internals::Utils::chdir($args->{'dir'}))
130 0 1 unless my $args = check($tmpl, \%hash)
132 0 1 unless (can_load("modules", {"File::Path", 0}))
139 0 1 if ($@)
168 0 19 unless check($tmpl, \%hash)
172 19 0 if ($perl eq $^X) { }
183 19 0 if defined $perl_version
204 0 71 unless check($tmpl, \%hash)
207 63 8 if $version =~ /^\d*(?:\.\d+)?$/
208 6 2 if (my($vers) = $version =~ /^(v?\d+(?:\.\d+(?:\.\d+)?)?)/)
241 0 63 unless check($tmpl, \%hash)
243 0 63 unless my $fh = sub { package CPANPLUS::Internals::Constants; use strict; my($file, $mode) = (@_, ''); my $fh; error(loc(q[Could not open file '%1': %2], $file, $!)) unless open $fh, "$mode" . $file; return $fh if $fh; return;}->($file)
270 0 2 unless check($tmpl, \%hash)
272 1 1 if (File::Copy::move($from, $to)) { }
301 0 0 unless check($tmpl, \%hash)
303 0 0 if (File::Copy::copy($from, $to)) { }
330 0 188 unless check($tmpl, \%hash)
334 64 124 -d $file ? :
336 188 0 if ($x and chmod $x->mode | $mask, $file) { }
364 0 2 unless check($tmpl, \%hash)
399 40 0 if (can_load("modules", {"File::HomeDir", 0}))
400 0 0 if (defined $ENV{'APPDATA'} and length $ENV{'APPDATA'} and Deparse error: Can't locate object method "object_2svref" via package "B::SPECIAL" at /usr/local/lib/perl5/5.42.0/B/Deparse.pm line 5762. )
404 40 0 if -d "File::HomeDir"->my_home
411 0 0 unless exists $ENV{$env}
412 0 0 unless defined $ENV{$env} and length $ENV{$env}
413 0 0 if -d $ENV{$env}
439 0 46 unless check($tmpl, \%hash)
510 0 344 unless my $file = shift()
512 0 344 unless my($dist, $version) = $file =~ /^ ((?:[-+.]*(?:[A-Za-z0-9]+|(?<=\D)_|_(?=\D))* (?: [A-Za-z](?=[^A-Za-z]|$) | \d(?=-) )(?
522 0 344 if ($dist =~ /-undef\z/ and not length $version)
529 5 339 if ($version =~ /^(-[Vv].*)-(\d.*)/)
537 0 344 if ($version =~ /(.+_.*)-(\d.*)/)
549 0 344 if not length $version and $dist =~ s/-(\d+\w)$//
552 0 344 if $version =~ /^\d+$/ and $dist =~ s/-(\w+)$//
555 308 36 if ($version =~ /\d\.\d/) { }
563 327 17 if (length $version) { }
564 24 303 if ($file =~ /^perl-?\d+\.(\d+)(?:\D(\d+))?(-(?:TRIAL|RC)\d+)?$/) { }
15 288 elsif ($version =~ /\d\D\d+_\d/ or $version =~ /-TRIAL/) { }
565 0 24 if $1 > 6 and $1 & 1 or $2 and $2 >= 50 or $3
646 0 344 unless check($tmpl, \%hash)
651 311 33 if ($str =~ m[([^/]+)\.(tar\.(?:[gx]?z|bz2)|zip|tbz|tgz|txz)$]i) { }
667 33 339 unless $str =~ /$re/xi
681 10 329 if $dpkg and $pkg ne $dpkg
682 12 327 if $dver and $ver ne $dver
704 0 3 unless check($tmpl, \%hash)
723 0 8 unless check($tmpl, \%hash)
741 0 95 unless check($tmpl, \%hash)
748 0 95 unless (chmod 0644, $file and utime $now, $now, $file)