Branch Coverage

blib/lib/Parse/CPAN/Packages/Fast.pm
Criterion Covered Total %
branch 37 64 57.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)
92 0 3 unless my $FH = 'IO::Uncompress::Gunzip'->new($packages_file)
96 3 17 if /^$/
114 0 1 unless exists $$self{'pkg_ver'}{$package_name}
130 0 0 unless exists $$self{'dist_to_pkgs'}{$distribution_name}
149 6 61780 if ($candidate =~ m[^./../.*/\Q$distribution_name\E])
155 6 0 if ($d->dist eq $distribution_name)
160 0 3 unless @candidates
165 2 1 if ('CPAN::Version'->vlt($best_candidate_version, $this_version))
179 68 61716 unless defined $dist
180 58236 3480 if (not exists $latest_dist{$dist}) { }
183 1598 1882 if ('CPAN::Version'->vlt($latest_dist{$dist}->version, $d->version))
200 0 13 if @_ != 4
205 0 13 if Search::Dict::look($pwhfh, $skey, 0, 1) == -1
208 12 1 if (index($got, $skey) == 0)
217 1 0 if lc substr($got, 0, length $skey) gt lc $skey
218 0 0 if eof $pwhfh
223 0 13 if @_ != 3
225 0 13 unless -e $orig_packages_file
226 1 12 if (not -e $cache_file or -M $cache_file > -M $orig_packages_file)
227 0 1 unless my $ifh = 'IO::Uncompress::Gunzip'->new($orig_packages_file)
231 0 1 unless my($tmpfh, $tmpfile) = File::Temp::tempfile('DIR', File::Basename::dirname($cache_file))
234 1 8 if /^$/
242 0 1 unless close $tmpfh
244 0 1 unless rename $tmpfile, $cache_file
247 0 13 unless open my $fh, $cache_file