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 { ;}->($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.26.1/B/Deparse.pm line 5018.
404 40 0 if -d "File::HomeDir"->my_home
410 0 0 unless exists $ENV{$env}
411 0 0 unless defined $ENV{$env} and length $ENV{$env}
412 0 0 if -d $ENV{$env}
438 0 46 unless check($tmpl, \%hash)
509 0 344 unless my $file = shift()
511 0 344 unless my($dist, $version) = $file =~ /^
521 0 344 if ($dist =~ /-undef\z/ and not length $version)
528 5 339 if ($version =~ /^(-[Vv].*)-(\d.*)/)
536 0 344 if ($version =~ /(.+_.*)-(\d.*)/)
548 0 344 if not length $version and $dist =~ s/-(\d+\w)$//
551 0 344 if $version =~ /^\d+$/ and $dist =~ s/-(\w+)$//
554 308 36 if ($version =~ /\d\.\d/) { }
562 327 17 if (length $version) { }
563 24 303 if ($file =~ /^perl-?\d+\.(\d+)(?:\D(\d+))?(-(?:TRIAL|RC)\d+)?$/) { }
15 288 elsif ($version =~ /\d\D\d+_\d/ or $version =~ /-TRIAL/) { }
564 0 24 if $1 > 6 and $1 & 1 or $2 and $2 >= 50 or $3
645 0 344 unless check($tmpl, \%hash)
650 311 33 if ($str =~ m[([^/]+)\.(tar\.(?:[gx]?z|bz2)|zip|tbz|tgz|txz)$]i) { }
666 33 339 unless $str =~ /$re/xi
680 10 329 if $dpkg and $pkg ne $dpkg
681 12 327 if $dver and $ver ne $dver
703 0 3 unless check($tmpl, \%hash)
722 0 8 unless check($tmpl, \%hash)
740 0 95 unless check($tmpl, \%hash)
747 0 95 unless (chmod 0644, $file and utime $now, $now, $file)