Branch Coverage

blib/lib/D64/Disk/Dir/Item.pm
Criterion Covered Total %
branch 152 170 89.4


line true false branch
199 100 47 if @_
233 112 20 if (scalar @args > 0)
234 17 95 if (scalar @args == 1)
236 6 11 if (ref $arg eq 'ARRAY')
241 11 101 if (scalar @args == 1) { }
97 4 elsif (scalar @args == 30) { }
243 11 0 if (not ref $arg) { }
244 4 7 unless (length $arg == 30)
256 2 2830 unless ($self->_is_valid_data_type($byte_value))
259 2 2828 unless ($self->_is_valid_byte_value($byte_value))
270 97 23 unless defined wantarray
271 5 18 wantarray ? :
277 2874 8 unless (ref $byte_value)
287 2828 0 if (length $byte_value == 1 and ord $byte_value >= 0 and ord $byte_value <= 255)
297 23 5 if ($self->is_int($number_value) and $number_value >= 0 and $number_value <= 255)
308 237 0 unless ord $_ < 0
22 1 unless (grep {ord $_ > 255 unless ord $_ < 0;} split(//, $string_value, 0))
357 41 67 if (defined $type)
358 1 40 if (ref $type)
361 1 39 unless ($self->is_int($type))
364 1 38 if ($type - ($type & 15))
368 2 36 unless (grep {$_ == $type;} @valid_values)
396 12 16 if (defined $is_closed)
397 1 11 if (ref $is_closed)
400 4 7 $is_closed ? :
426 10 12 if (defined $is_locked)
427 1 9 if (ref $is_locked)
430 5 4 $is_locked ? :
452 9 6 if (defined $track)
453 1 8 unless ($self->_is_valid_data_type($track))
456 2 6 unless ($self->_is_valid_number_value($track))
480 9 6 if (defined $sector)
481 1 8 unless ($self->_is_valid_data_type($sector))
484 2 6 unless ($self->_is_valid_number_value($sector))
534 26 71 if (scalar(@options) % 2 == 1)
538 37 60 unless exists $options{'padding_with_a0'}
540 26 71 if (defined $name)
541 2 24 unless ($self->is_str($name))
544 1 23 if (length $name > 16)
547 1 22 unless ($self->is_valid_string_value($name))
550 13 9 if ($options{'padding_with_a0'})
559 60 33 unless ($options{'padding_with_a0'})
588 7 5 if (defined $side_track)
589 1 6 unless ($self->type eq $T_REL)
592 1 5 unless ($self->_is_valid_data_type($side_track))
595 2 3 unless ($self->_is_valid_number_value($side_track))
601 1 7 unless $self->type eq $T_REL
625 7 5 if (defined $side_sector)
626 1 6 unless ($self->type eq $T_REL)
629 1 5 unless ($self->_is_valid_data_type($side_sector))
632 2 3 unless ($self->_is_valid_number_value($side_sector))
638 1 7 unless $self->type eq $T_REL
662 9 6 if (defined $record_length)
663 1 8 unless ($self->type eq $T_REL)
666 1 7 unless ($self->_is_valid_data_type($record_length))
669 2 5 unless ($self->_is_valid_number_value($record_length))
672 1 4 unless ($record_length >= 0 and $record_length < 255)
678 1 9 unless $self->type eq $T_REL
700 12 12 if (defined $size)
701 2 10 unless ($self->_is_valid_data_type($size) and $self->is_int($size))
704 1 9 unless ($size >= 0 and $size <= 65535)
762 2 2 if ($as_petscii) { }
764 1 1 $self->closed ? :
765 1 1 $self->locked ? :
773 1 1 $self->closed ? :
774 1 1 $self->locked ? :
803 0 3 unless defined $data
807 0 3 unless defined $type
811 0 2 unless defined $closed
815 0 2 unless defined $locked
819 0 2 unless defined $track
823 0 2 unless defined $sector
827 0 2 unless defined $name
830 0 2 if ($self->type eq $T_REL)
833 0 0 unless defined $side_track
837 0 0 unless defined $side_sector
841 0 0 unless defined $record_length
846 0 2 unless defined $size
930 14 121 if ($match_pattern == 42)
934 110 11 unless (defined $character and $match_pattern == 63)
935 4 106 if (not defined $character or ord $character != $match_pattern)
941 7 4 if (@name == @pattern)
961 13 10 if (not $as_petscii) { }
972 12 1 if ($type >= 0 and $type < @mapping) { }
990 9 1 if ($type >= 0 and $type < @mapping) { }