Branch Coverage

blib/lib/HTTP/RangeSaver.pm
Criterion Covered Total %
branch 49 70 70.0


line true false branch
101 0 13 if (exists $params{'delta'}) { }
158 13 228 if ($off) { }
180 0 7 if defined $length and $length eq '*'
228 1 8 unless $$self{'ranges'}
242 0 0 unless $$self{'partheaders'}
286 0 1 unless print {$$self{'fh'};} $data
304 4 24 if ($len > $expected) { }
314 7 21 unless ($expected)
332 116 6 unless $buffer =~ /\x0D?\x0A\x0D?\x0A/
346 0 12 unless ($name, $value) = $line =~ /^([^\s:]+)\s*:\s*(.*)$/
352 0 6 unless defined $content_range
355 3 3 unless (defined $$self{'type'})
375 6 61 if ($buffer =~ /$$self{'start_boundary'}/) { }
2 59 elsif ($buffer =~ /$$self{'end_boundary'}/) { }
401 6 7 if ($code == 206) { }
5 2 elsif ($code == 200 or $code == 203) { }
402 3 3 if (defined(my $content_range = $resp->header('Content-Range'))) { }
3 0 elsif (defined $content_type) { }
410 0 3 unless ($ct eq 'multipart/byteranges' and defined($boundary = $params{'boundary'}))
424 1 4 if ($$self{'require_partial'})
427 2 2 if (defined(my $content_length = $resp->header('Content-Length'))) { }
429 0 2 if ($$self{'truncate'})
430 0 0 unless truncate $fh, $content_length + $delta
434 2 0 if ($content_length > 0)
438 1 1 if ($$self{'require_length'})
443 0 3 unless seek $fh, $delta, 0
445 3 0 if ($$methods[-1] ne 'ignore')
450 1 1 if ($$self{'require_resource'})
465 0 9 unless (($first, $last, $length) = $content_range =~ /$content_range_re/ and $last >= $first and $length eq '*' || $last < $length)
472 6 3 unless (defined $$self{'length'})
474 1 5 if ($length eq '*') { }
475 1 0 if ($$self{'require_length'})
479 0 5 if ($$self{'truncate'})
480 0 0 unless truncate $fh, $length + $delta
485 0 8 unless seek $fh, $first + $delta, 0