Branch Coverage

blib/lib/LWP/UserAgent/Cached.pm
Criterion Covered Total %
branch 48 56 85.7


line true false branch
35 13 8 if (@_)
48 0 3 if ($bool)
57 0 33 unless (defined $self->{'cache_dir'})
67 27 6 unless ($self->{'was_redirect'})
72 19 14 if (-e $fpath)
73 3 16 unless ($response = $self->_parse_cached_response($fpath, $request))
75 2 1 if (my(@cache_list) = glob($fpath . '-*')) { }
77 1 2 if ($response = $self->_parse_cached_response($cache_file, $request))
83 1 1 unless ($response)
92 1 16 if ($response and defined $self->{'recache_if'} and $self->{'recache_if'}->($response, $fpath, $request))
97 16 17 if ($response) { }
98 1 16 if (defined $self->{'on_uncached'})
104 16 1 unless (defined $self->{'nocache_if'} and $self->{'nocache_if'}->($response))
105 2 14 if (defined $no_collision_suffix)
109 16 0 if (open my $fh, '>:raw', $fpath) { }
133 3 0 exists $self->{'last_cached'} ? :
139 2 0 exists $self->{'last_used_cache'} ? :
150 5 29 if (defined $self->{'cachename_spec'} and %{$self->{'cachename_spec'};})
153 3 2 if (exists $self->{'cachename_spec'}{'_headers'})
154 0 3 unless ref $self->{'cachename_spec'}{'_headers'} eq 'ARRAY'
160 5 10 if (exists $self->{'cachename_spec'}{$hname}) { }
9 2 elsif ($leave_only_specified and not &_in($hname, $self->{'cachename_spec'}{'_headers'})) { }
161 4 1 if (defined $self->{'cachename_spec'}{$hname}) { }
173 3 2 if (exists $self->{'cachename_spec'}{'_body'})
187 0 22 unless (open $fh, '<:raw', $cache_file)
194 5 17 if ($url ne $request->url)
206 17 0 if ($self->cookie_jar)
217 6 1 if $what eq $item