Branch Coverage

blib/lib/Tie/DictFile.pm
Criterion Covered Total %
branch 52 94 55.3


line true false branch
23 3 0 @_ ? :
25 0 3 unless my $fh = 'IO::File'->new($dictionary, 'r')
34 0 12 if length $_[1] > $Tie::DictFile::MAX_WORD_LENGTH
62 4 4 unless (defined $word)
64 0 4 if (defined $k)
80 0 4 if length $word > $Tie::DictFile::MAX_WORD_LENGTH
83 0 4 if $word =~ /[\r\n]/s
86 0 4 unless length $word
89 2 2 if (not defined $value) { }
2 0 elsif (not $self->EXISTS($word)) { }
111 0 2 if (exists $$self{'not_in_file'}{$lcword}) { }
0 2 elsif (exists $$self{'delete_from_file'}{$lcword}) { }
0 2 elsif (exists $$self{'add_to_file'}{$lcword}) { }
2 0 elsif (exists $$self{'in_file'}{$lcword}) { }
0 0 elsif (defined($found_word = $self->_exists_in_file($word))) { }
144 4 2 if (keys %{$$self{'delete_from_file'};} or keys %{$$self{'add_to_file'};})
147 0 4 unless -w $$self{'dictionary'}
153 4 4 if (exists $$self{'add_to_file'}{$word}) { }
154 0 4 unless exists $$self{'insert_pos'}{$word}
161 0 0 unless exists $$self{'in_file'}{$word} or $self->_exists_in_file($word)
172 0 4 unless my $fhout = 'IO::File'->new("> $filename")
182 2 4 if ($$operation[0] eq 'insert_at') { }
2 2 elsif ($$operation[0] eq 'copy_until') { }
183 0 2 if ($$operation[1] > $last_position)
197 2 0 if ($last_position < $size)
220 1 3 if ($$self{'fh'})
235 0 14 if length $word > $Tie::DictFile::MAX_WORD_LENGTH
241 2 12 if (exists $$self{'add_to_file'}{$lcword}) { }
2 10 elsif (exists $$self{'delete_from_file'}{$lcword}) { }
5 5 elsif (exists $$self{'in_file'}{$lcword}) { }
2 3 elsif (exists $$self{'not_in_file'}{$lcword}) { }
269 0 3 unless my(@stat) = stat $fh
282 0 3 unless $fh->seek($min, 0)
285 0 3 if $min
292 1 3 if $lcread_word lt $lcword
294 0 3 if ($lcread_word eq $lcword) { }
311 12 4 if ($$self{'fh'} and $line = $$self{'fh'}->getline) { }
326 0 12 if (exists $$self{'in_file_a'} and @{$$self{'in_file_a'};} == $Tie::DictFile::CACHE_SIZE)
345 0 0 if (exists $$self{'block_cache'}{$mid}) { }
349 0 0 unless $fh->seek($mid * $blksize, 0)
353 0 0 if $mid
359 0 0 if (defined $line_read and $line_read le $word) { }
372 0 0 unless ($level =~ /^\d+$/)
376 0 0 if ($Tie::DictFile::DEBUG >= $level)
379 0 0 unless $x =~ /\n$/
391 2 2 $last ? :
393 0 4 if ($bytes != $byte_mark - $last_position)