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 34 unless (defined $self->{'cache_dir'})
67 28 6 unless ($self->{'was_redirect'})
72 19 15 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 18 if ($response) { }
98 1 17 if (defined $self->{'on_uncached'})
104 17 1 unless (defined $self->{'nocache_if'} and $self->{'nocache_if'}->($response))
105 2 15 if (defined $no_collision_suffix)
109 17 0 if (open my $fh, '>:raw', $fpath) { }
133 3 0 exists $self->{'last_cached'} ? :
139 2 0 exists $self->{'last_used_cache'} ? :
150 5 30 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