Branch Coverage

blib/lib/App/HTTP_Proxy_IMP/IMP/FakeResponse.pm
Criterion Covered Total %
branch 4 54 7.4


line true false branch
17 0 1 unless my $dir = $args{'root'}
18 0 1 unless -d $dir and -r _ and -x _
29 0 1 if (not $dir) { }
0 1 elsif (not -d $dir && -r _ && -x _) { }
41 0 0 if $hdr =~ /\nHost: *(\S+)/i
42 0 0 unless ($host)
48 0 0 $host =~ s/^(?:\[(\w._\-:)+\]|(\w._\-))(?::(\d+))?$/$2 unless $1;/e ? :
49 0 0 unless $1
53 0 0 unless -d $dir
56 0 0 $path =~ s/\?(.+)// ? :
67 0 0 if $self->{'factory_args'}{'ignore_parameters'}
69 0 0 if defined $qstring
71 0 0 if ($method ~~ ['GET', 'HEAD'])
72 0 0 if $file{'md5data'}
78 0 0 unless -f $fname or glob "$fname-*"
86 0 0 if ($self->{'response'} = _extract_response($fname))
106 0 0 unless my $f = $self->{'file'}
108 0 0 if ($data ne '')
119 0 0 $f->{'md5data'} ? :
123 0 0 if ($self->{'response'} = _extract_response($fname))
144 0 0 unless my $rphdr = $self->{'response'} && $self->{'response'}[0]
147 0 0 unless $rphdr =~ s/(\nContent-length:[ \t]*)\d+/$1$clen/
155 0 0 unless my $rp = $self->{'response'}
167 0 0 unless $self->{'file'}
177 0 0 unless open my $fh, '<', $fname
179 0 0 if ($data =~ s[\A(HTTP/1\.[01] .*?(\r?\n)\2)][]s) { }
184 0 0 if ($size[0] + $size[1] + $size[2] + $size[3] + 16 == length $data)