Branch Coverage

blib/lib/Plack/Middleware/Deflater.pm
Criterion Covered Total %
branch 29 58 50.0


line true false branch
11 1 2 if (my $match_cts = $self->content_type)
12 1 0 unless ref $match_cts
28 0 1 if $env->{'HTTP_CONTENT_RANGE'}
30 0 1 if $env->{'plack.skip-deflater'}
35 1 0 if (my $match_cts = $self->content_type)
38 1 0 if ($content_type eq $match_ct)
43 0 1 unless $match
46 0 1 if (Plack::Util::status_with_no_entity_body($res->[0]) or $h->exists("Cache-Control") and $h->get("Cache-Control") =~ /\bno-transform\b/)
54 1 0 if $self->vary_user_agent
58 0 1 if $h->exists("Content-Encoding") and $h->get("Content-Encoding") ne "identity"
61 0 1 if $env->{'psgix.no-compress'}
65 0 1 if ($env->{'psgix.compress-only-text/html'})
66 0 0 if $content_type ne "text/html"
71 1 0 if (defined $env->{'HTTP_ACCEPT_ENCODING'})
73 1 0 if ($env->{'HTTP_ACCEPT_ENCODING'} =~ /\b$enc\b/)
81 1 0 if ($encoding eq "gzip" or $encoding eq "deflate")
85 1 0 if ($encoder)
90 1 0 if ($res->[2] and ref $res->[2] and ref $res->[2] eq "ARRAY")
93 1 0 if defined $_
122 1 0 $encoding eq 'gzip' ? :
126 0 1 if $status != Z_OK()
140 0 2 if $self->{'closed'}
142 1 1 unless (defined $chunk)
144 0 1 if $status != Z_OK()
145 1 0 if (not $self->{'header'} and $self->{'encoding'} eq "gzip")
149 1 0 if $self->{'encoding'} eq "gzip"
155 0 1 if $status != Z_OK()
158 0 1 if (length $buf)
159 0 0 if (not $self->{'header'} and $self->{'encoding'} eq "gzip")