Branch Coverage

blib/lib/D64/Disk/Layout/Dir.pm
Criterion Covered Total %
branch 160 178 89.8


line true false branch
193 40 218 if exists $args{'data'}
194 131 116 if exists $args{'items'}
195 10 236 if exists $args{'sectors'}
205 1 54 unless (defined $data)
210 40 14 ref $data ? :
218 6 47 unless (scalar @{$data;} == $expected_data_size)
224 1 202778 if (ref $byte_value)
227 2 202776 unless ($self->_is_valid_byte_value($byte_value))
240 3 57 unless (scalar @{$sectors;} == $expected_sectors_size)
247 0 57 unless (defined $sectors)
251 0 57 unless (ref $sectors eq 'ARRAY')
255 1 56 unless (scalar @{$sectors;} == $expected_sectors_size)
261 0 1008 unless ($sector_value->isa('D64::Disk::Layout::Sector'))
280 1 8715 if ($test_sector->track == $track and $test_sector->sector == $sector)
294 0 1080 unless defined $track and defined $sector
297 1080 8584 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 55 100 if (@args)
361 50 5 scalar @args == 1 ? :
387 21 20715 if ($i % $ITEMS_PER_SECTOR == 0 and $i + $ITEMS_PER_SECTOR < $num_items) { }
118 20597 elsif ($i % $ITEMS_PER_SECTOR == 0 and $i + $ITEMS_PER_SECTOR >= $num_items and $i < $num_items) { }
26 20571 elsif ($i == 0 and $num_items == 0) { }
2427 18144 elsif ($i % $ITEMS_PER_SECTOR == 0) { }
407 25 119 wantarray ? :
436 100 28 if $track == 0
447 28 15328 if ($track_order[$j] == $track and $sector_order[$j] == $sector)
478 142 21 if (@args)
480 136 0 ref $arg ? :
136 6 scalar @args == 1 ? :
524 645 2209 if $item->empty
554 60 12 if (@args)
556 11 0 ref $arg ? :
11 49 scalar @args == 1 ? :
582 56 952 unless defined $track and defined $sector
598 38 9754 if ($j == 0 and ($i + 1) * $ITEMS_PER_SECTOR < $num_items) { }
57 9697 elsif ($j == 0 and ($i + 1) * $ITEMS_PER_SECTOR >= $num_items and $i * $ITEMS_PER_SECTOR < $num_items) { }
11 9686 elsif ($i == 0 and $j == 0 and $num_items == 0) { }
1118 8568 elsif ($j == 0) { }
648 2 3 if ($mode eq 'all') { }
3 0 elsif ($mode eq 'used') { }
671 0 72 unless $sector_object
721 0 11 if (exists $args{'index'} and exists $args{'pattern'})
725 0 6 unless (exists $args{'index'} or exists $args{'pattern'})
732 11 6 if (exists $args{'index'}) { }
739 4 2 if ($index < $num_items) { }
755 7 11 unless $is_matched
768 39 10 if ('D64::Disk::Dir::Item'->is_int($index) and $index >= 0 and $index <= $maximum_allowed_position)
772 5 19 $self->_is_valid_number_value($index) ? :
788 46 4 if (defined $pattern and not ref $pattern and is_valid_petscii_string($pattern) and length $pattern > 0 and length $pattern <= 16)
792 4 4 is_printable_petscii_string($pattern) ? :
2 8 ref $pattern ? :
796 0 8 $self->_is_valid_number_value($pattern) ? :
2 8 !defined($pattern) ? :
822 2 58 unless (defined $item)
826 4 50 unless (ref $item and $item->isa('D64::Disk::Dir::Item'))
847 1 9 if ($num_items >= $MAX_ENTRIES)
878 4 14 if $last_item_index < 0
901 4 17 if $last_item_index < 0
925 1 12 if ($num_items >= $MAX_ENTRIES)
974 1 10 if (exists $args{'index'} and exists $args{'pattern'})
978 1 23 unless (exists $args{'index'} or exists $args{'pattern'})
989 10 23 if (exists $args{'index'}) { }
993 4 1 if ($index < $num_items) { }
1012 25 10 if ($item->match_name($pattern))
1019 11 14 if $count and not $global
1036 5 24 if ($was_closed == $is_closed and $was_deleted == $is_deleted)
1076 1 10 if (exists $args{'index'} and exists $args{'pattern'})
1080 1 27 unless (exists $args{'index'} or exists $args{'pattern'})
1091 10 27 if (exists $args{'index'}) { }
1095 4 1 if ($index < $num_items) { }
1113 24 16 if ($item->match_name($pattern))
1120 13 11 unless $global
1166 2 22 unless (exists $args{'item'})
1178 12 8 if (defined $index) { }
1181 8 0 if (defined $first_empty_slot)
1189 1 7 if ($num_items >= $MAX_ENTRIES)
1193 7 1 if ($index <= $num_items)
1212 8 10 if ($item->writable)
1236 1 21 unless (exists $args{'index'})
1239 1 20 unless (exists $args{'item'})
1252 12 1 if ($index <= $num_items)
1313 202776 0 if (length $byte_value == 1 and ord $byte_value >= 0 and ord $byte_value <= 255)
1323 5 11 if ('D64::Disk::Dir::Item'->is_int($number_value) and $number_value >= 0 and $number_value <= 255)
1333 0 29 if ($self->_is_valid_number_value($value))
1337 11 18 if ($self->is_numeric($value))