Branch Coverage

blib/lib/WARC/Record/FromVolume.pm
Criterion Covered Total %
branch 51 66 77.2


line true false branch
30 1 2 $swap ? :
3 131 unless defined $b->volume
32 119 12 $a->volume->filename eq $b->volume->filename || $a->volume->_file_tag eq $b->volume->_file_tag ? :
38 1 130 $swap ? :
87 32 4 if defined $self->{'compression'}
94 16 20 if defined $self->{'sl_full_size'}
97 32 4 defined $self->{'compression'} ? :
106 1 2 if (not defined $self->{'compression'}) { }
1 1 elsif ($self->{'compression'} eq 'IO::Uncompress::Gunzip') { }
123 4 628 if (ref $offset) { }
128 0 628 unless seek $handle, $offset, 0
134 0 632 unless defined read($handle, $magic, 6)
135 28 604 if $magic eq ''
137 512 92 if ($magic eq 'WARC/1') { }
90 2 elsif (unpack('H4', $magic) eq '1f8b') { }
143 35 55 if (unpack('x3C', $magic) & 4)
144 0 35 unless defined read($handle, $magic, 6, 6)
146 0 35 unless defined read($handle, $extra, $xlen)
151 20 10 if ($extra[$i] eq 'sl' and length $extra[1 + $i] == 8)
156 0 90 unless $handle = 'IO::Uncompress::Gunzip'->new($handle, 'Prime', $magic, 'MultiStream', 0, 'AutoClose', 1, 'Transparent', 0)
171 0 602 unless $protocol =~ /^WARC/
198 0 162 if (defined $self->{'logical'}) { }
0 162 elsif (defined $segment_header_value) { }
214 12 343 if ($self->{'sl_packed_size'}) { }
311 32 elsif (not defined $self->{'compression'}) { }
218 0 12 unless seek $handle, $self->offset + $self->{'sl_packed_size'} - 4, 0
220 0 12 unless defined read($handle, $isize, 4)
222 4 8 if (length $isize > 0 and $self->{'sl_full_size'} == unpack('V', $isize)) { }
238 0 40 unless seek $handle, $self->offset, 0
241 0 40 unless my $zhandle = $self->{'compression'}->new($handle, 'MultiStream', 0, 'AutoClose', 0)
243 0 40 unless seek $zhandle, $self->{'data_offset'} + $self->field('Content-Length'), 0
245 0 40 unless defined read($zhandle, $end, 4)
247 0 40 unless $end eq "\r\n\r\n"