Branch Coverage

blib/lib/Plack/App/File/Range.pm
Criterion Covered Total %
branch 20 34 58.8


line true false branch
9 1 7 unless my $range = $$env{'HTTP_RANGE'}
12 0 7 unless $range =~ s/^bytes=//
15 0 7 unless my(@ranges) = split(/\s*,\s*/, $range, 0)
19 7 0 if ($content_type =~ m[^text/])
26 6 1 if (@ranges == 1)
27 0 6 unless my($start, $end) = $self->_parse_range($range, $len)
31 0 0 unless open my $fh, "<:raw:subfile(start=$start,end=" . ($end + 1) . ')', $file
49 0 1 unless open my $fh, '<:raw', $file
59 0 2 unless my($start, $end) = $self->_parse_range($range, $len)
82 0 8 unless $range =~ /^(\d*)-(\d*)$/
86 4 4 if (length $start and length $end) { }
1 3 elsif (length $start) { }
3 0 elsif (length $end) { }
87 0 4 if $start > $end
88 0 4 if $end >= $len
92 0 1 if $start >= $len
96 0 3 if $end > $len