Branch Coverage

blib/lib/Plack/Middleware/Deflater.pm
Criterion Covered Total %
branch 27 58 46.5


line true false branch
11 1 0 if (my $match_cts = $self->content_type)
12 1 0 unless ref $match_cts
26 0 1 if $$env{'HTTP_CONTENT_RANGE'}
28 0 1 if $$env{'plack.skip-deflater'}
33 1 0 if (my $match_cts = $self->content_type)
36 1 0 if ($content_type eq $match_ct)
41 0 1 unless $match
44 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/)
51 1 0 if $self->vary_user_agent
55 0 1 if $$env{'psgix.no-compress'}
59 0 1 if ($$env{'psgix.compress-only-text/html'})
60 0 0 if $content_type ne 'text/html'
65 1 0 if (defined $$env{'HTTP_ACCEPT_ENCODING'})
67 1 0 if ($$env{'HTTP_ACCEPT_ENCODING'} =~ /\b$enc\b/)
75 1 0 if ($encoding eq 'gzip' or $encoding eq 'deflate') { }
0 0 elsif ($encoding ne 'identity') { }
83 1 0 if ($encoder)
88 1 0 if ($$res[2] and ref $$res[2] and ref $$res[2] eq 'ARRAY')
91 1 0 if defined $_
119 1 0 $encoding eq 'gzip' ? :
122 0 1 if $status != Z_OK()
136 0 2 if $$self{'closed'}
138 1 1 unless (defined $chunk)
140 0 1 if $status != Z_OK()
141 1 0 if (not $$self{'header'} and $$self{'encoding'} eq 'gzip')
144 1 0 if $$self{'encoding'} eq 'gzip'
150 0 1 if $status != Z_OK()
153 0 1 if (length $buf)
154 0 0 if (not $$self{'header'} and $$self{'encoding'} eq 'gzip')