Branch Coverage

blib/lib/Parse/CPAN/Packages/Fast.pm
Criterion Covered Total %
branch 38 68 55.8


line true false branch
53 2 0 unless ($INC{'CPAN/MyConfig.pm'})
55 2 0 if (-r $home_myconfig)
60 2 0 if ($INC{'CPAN/MyConfig.pm'} and $CPAN::Config->{'keep_source_where'})
62 2 0 if (-r $packages_file and -s $packages_file)
69 0 0 if (-r $packages_file and -s $packages_file)
81 0 3 unless ($packages_file)
83 0 0 unless ($packages_file)
93 0 3 if (not $packages_file =~ /\.gz$/) { }
94 0 0 unless open $FH, '<', $packages_file
97 0 3 unless $FH = 'IO::Uncompress::Gunzip'->new($packages_file)
102 3 17 if /^$/
120 0 1 unless exists $self->{'pkg_ver'}{$package_name}
136 0 0 unless exists $self->{'dist_to_pkgs'}{$distribution_name}
155 6 66262 if ($candidate =~ m[^./../.*/\Q$distribution_name\E])
161 6 0 if ($d->dist eq $distribution_name)
166 0 3 unless @candidates
171 2 1 if ('CPAN::Version'->vlt($best_candidate_version, $this_version))
185 68 66198 unless defined $dist
186 62286 3912 if (not exists $latest_dist{$dist}) { }
189 1718 2194 if ('CPAN::Version'->vlt($latest_dist{$dist}->version, $d->version))
206 0 13 if @_ != 4
211 0 13 if Search::Dict::look($pwhfh, $skey, 0, 1) == -1
214 12 1 if (index($got, $skey) == 0)
223 1 0 if lc substr($got, 0, length $skey) gt lc $skey
224 0 0 if eof $pwhfh
229 0 13 if @_ != 3
231 0 13 unless -e $orig_packages_file
232 1 12 if (not -e $cache_file or -M $cache_file > -M $orig_packages_file)
233 0 1 unless my $ifh = 'IO::Uncompress::Gunzip'->new($orig_packages_file)
237 0 1 unless my($tmpfh, $tmpfile) = File::Temp::tempfile('DIR', File::Basename::dirname($cache_file))
240 1 8 if /^$/
248 0 1 unless close $tmpfh
250 0 1 unless rename $tmpfile, $cache_file
253 0 13 unless open my $fh, $cache_file