Branch Coverage

blib/lib/D64/Disk/Layout/Dir.pm
Criterion Covered Total %
branch 156 174 89.6


line true false branch
193 39 218 if exists $args{'data'}
194 131 115 if exists $args{'items'}
195 10 235 if exists $args{'sectors'}
205 1 53 unless (defined $data)
210 40 13 ref $data ? :
218 6 46 unless (scalar @{$data;} == $expected_data_size)
224 1 198170 if (ref $byte_value)
227 2 198168 unless ($self->_is_valid_byte_value($byte_value))
240 3 56 unless (scalar @{$sectors;} == $expected_sectors_size)
247 0 56 unless (defined $sectors)
251 0 56 unless (ref $sectors eq 'ARRAY')
255 1 55 unless (scalar @{$sectors;} == $expected_sectors_size)
261 0 990 unless ($sector_value->isa('D64::Disk::Layout::Sector'))
280 1 8562 if ($test_sector->track == $track and $test_sector->sector == $sector)
294 0 1061 unless defined $track and defined $sector
297 1061 8431 if ($sector_object->track == $track and $sector_object->sector == $sector)
310 0 142 unless (defined $items)
314 0 142 unless (ref $items eq 'ARRAY')
318 1 141 unless (scalar @{$items;} <= $expected_items_size)
324 0 1671 unless ($item_value->isa('D64::Disk::Dir::Item'))
327 0 1671 unless ($item_value->validate)
359 54 99 if (@args)
361 49 5 scalar @args == 1 ? :
387 21 20427 if ($i % $ITEMS_PER_SECTOR == 0 and $i + $ITEMS_PER_SECTOR < $num_items) { }
118 20309 elsif ($i % $ITEMS_PER_SECTOR == 0 and $i + $ITEMS_PER_SECTOR >= $num_items and $i < $num_items) { }
24 20285 elsif ($i == 0 and $num_items == 0) { }
404 25 117 wantarray ? :
433 98 28 if $track == 0
444 28 15022 if ($track_order[$j] == $track and $sector_order[$j] == $sector)
475 142 21 if (@args)
477 136 0 ref $arg ? :
136 6 scalar @args == 1 ? :
521 642 2209 if $item->empty
551 59 12 if (@args)
553 11 0 ref $arg ? :
11 48 scalar @args == 1 ? :
579 55 935 unless defined $track and defined $sector
595 38 9610 if ($j == 0 and ($i + 1) * $ITEMS_PER_SECTOR < $num_items) { }
57 9553 elsif ($j == 0 and ($i + 1) * $ITEMS_PER_SECTOR >= $num_items and $i * $ITEMS_PER_SECTOR < $num_items) { }
10 9543 elsif ($i == 0 and $j == 0 and $num_items == 0) { }
642 2 3 if ($mode eq 'all') { }
3 0 elsif ($mode eq 'used') { }
665 0 71 unless $sector_object
715 0 11 if (exists $args{'index'} and exists $args{'pattern'})
719 0 6 unless (exists $args{'index'} or exists $args{'pattern'})
726 11 6 if (exists $args{'index'}) { }
733 4 2 if ($index < $num_items) { }
749 7 11 unless $is_matched
762 39 10 if ('D64::Disk::Dir::Item'->is_int($index) and $index >= 0 and $index <= $maximum_allowed_position)
766 5 19 $self->_is_valid_number_value($index) ? :
782 46 4 if (defined $pattern and not ref $pattern and is_valid_petscii_string($pattern) and length $pattern > 0 and length $pattern <= 16)
786 4 4 is_printable_petscii_string($pattern) ? :
2 8 ref $pattern ? :
790 0 8 $self->_is_valid_number_value($pattern) ? :
2 8 !defined($pattern) ? :
816 2 58 unless (defined $item)
820 4 50 unless (ref $item and $item->isa('D64::Disk::Dir::Item'))
841 1 9 if ($num_items >= $MAX_ENTRIES)
872 4 14 if $last_item_index < 0
895 4 17 if $last_item_index < 0
919 1 12 if ($num_items >= $MAX_ENTRIES)
968 1 10 if (exists $args{'index'} and exists $args{'pattern'})
972 1 23 unless (exists $args{'index'} or exists $args{'pattern'})
983 10 23 if (exists $args{'index'}) { }
987 4 1 if ($index < $num_items) { }
1006 25 10 if ($item->match_name($pattern))
1013 11 14 if $count and not $global
1030 5 24 if ($was_closed == $is_closed and $was_deleted == $is_deleted)
1070 1 10 if (exists $args{'index'} and exists $args{'pattern'})
1074 1 27 unless (exists $args{'index'} or exists $args{'pattern'})
1085 10 27 if (exists $args{'index'}) { }
1089 4 1 if ($index < $num_items) { }
1107 24 16 if ($item->match_name($pattern))
1114 13 11 unless $global
1160 2 22 unless (exists $args{'item'})
1172 12 8 if (defined $index) { }
1175 8 0 if (defined $first_empty_slot)
1183 1 7 if ($num_items >= $MAX_ENTRIES)
1187 7 1 if ($index <= $num_items)
1206 8 10 if ($item->writable)
1230 1 21 unless (exists $args{'index'})
1233 1 20 unless (exists $args{'item'})
1246 12 1 if ($index <= $num_items)
1307 198168 0 if (length $byte_value == 1 and ord $byte_value >= 0 and ord $byte_value <= 255)
1317 5 11 if ('D64::Disk::Dir::Item'->is_int($number_value) and $number_value >= 0 and $number_value <= 255)
1327 0 29 if ($self->_is_valid_number_value($value))
1331 11 18 if ($self->is_numeric($value))