Branch Coverage

blib/lib/AppleII/Disk.pm
Criterion Covered Total %
branch 46 68 67.6


line true false branch
64 0 4 unless $mode
66 4 0 if ($mode =~ /w/)
69 2 2 unless -e $filename
72 0 4 unless $file->open($filename, $openMode)
79 2 2 if $mode =~ /p/
80 1 3 if $mode =~ /d/
81 1 0 $filename =~ /\.(?:hdv|po)$/i ? :
1 3 if $type eq 'AppleII::Disk'
107 0 32 unless defined $pad
110 11 21 if length $pad and length $data < $length
113 1 31 unless (length $data == $length)
115 1 0 if (caller)[0] =~ /^AppleII::Disk::/
136 3 3 if (@_)
138 0 3 if $$self{'maxlen'} < $$self{'actlen'}
152 0 0 if ($$self{'maxlen'} > $$self{'actlen'})
153 0 0 unless $$self{'writable'}
155 0 0 unless $$self{'file'}->truncate($$self{'maxlen'})
194 24 1020 if ($_) { }
245 13 258 if $_
287 1 54 if $self->seek_block($_[0]) >= $$self{'actlen'}
290 0 54 unless read $$self{'file'}, $buffer, 512
312 1 75 if $pos < 0 or $pos >= $$self{'maxlen'}
315 0 75 unless $$self{'file'}->seek($pos, 0)
328 0 21 unless $$self{'writable'}
333 0 20 unless print {$$self{'file'};} $data
335 1 19 unless $$self{'actlen'} > $pos
390 2 4 if $self->seek_sector(@_[0, 1]) >= $$self{'actlen'}
393 0 4 unless read $$self{'file'}, $buffer, 256
413 1 12 if $pos < 0 or $pos >= $$self{'maxlen'}
416 0 12 unless $$self{'file'}->seek($pos, 0)
428 0 6 unless $$self{'writable'}
433 0 6 unless print {$$self{'file'};} $data
435 2 4 unless $$self{'actlen'} > $pos
446 0 1 unless $$self{'writable'}