Branch Coverage

blib/lib/Games/Rezrov/ZDict.pm
Criterion Covered Total %
branch 43 630 6.8


line true false branch
316 0 1 if ($addr) { }
331 0 4 if ($z_version >= 5) { }
342 4 0 if $z_version <= 4
364 0 4 if ($self->version >= 5)
365 0 0 unless defined $text_len
386 4 29 if ($text_p >= $text_end) { }
391 6 23 unless $start_offset
393 2 27 if ($c eq ' ') { }
0 27 elsif (exists $$separators{$c}) { }
395 2 0 if ($token ne '') { }
406 0 0 if ($token ne '') { }
420 6 27 if ($token_done)
422 6 0 if $token ne ''
429 0 0 if (@tokens == 3 and Games::Rezrov::ZOptions::SHAMELESS() and $tokens[0][0] =~ /^(who|what)$/i and $tokens[1][0] =~ /^is$/ and $tokens[2][0] =~ /^(michae\w*|edmons\w*)/)
435 0 0 unless ($self->get_dictionary_address($1))
453 6 0 if ($wrote_tokens++ < $max_tokens) { }
455 2 4 if length $token > $encoded_length
458 0 6 if ($addr == 0)
460 0 0 if (Games::Rezrov::ZOptions::EMULATE_NOTIFY() and $token eq 'notify') { }
0 0 elsif (lc $token eq '#speak') { }
0 0 elsif (lc $untrunc_token eq '#listen') { }
0 0 elsif (lc $token eq '#typo') { }
0 0 elsif (Games::Rezrov::ZOptions::EMULATE_HELP() and $token eq 'help') { }
0 0 elsif (Games::Rezrov::ZOptions::EMULATE_OOPS() and $oops_word || ($token eq 'oops' || Games::Rezrov::ZOptions::ALIASES() && $token eq 'o')) { }
0 0 elsif (Games::Rezrov::ZOptions::MAGIC() and exists $Games::Rezrov::ZDict::MAGIC_WORDS{$untrunc_token}) { }
0 0 elsif (Games::Rezrov::ZOptions::ALIASES() and exists $Games::Rezrov::ZDict::ALIASES{$untrunc_token}) { }
0 0 elsif (Games::Rezrov::ZOptions::EMULATE_COMMAND_SCRIPT() and $untrunc_token eq '#reco' or $untrunc_token eq '#unre' or $untrunc_token eq '#comm') { }
0 0 elsif ($untrunc_token eq '#cheat') { }
467 0 0 if ($zio->speaking) { }
471 0 0 if ($zio->init_speech_synthesis) { }
487 0 0 if ($zio->listening) { }
491 0 0 if ($zio->init_speech_recognition) { }
505 0 0 $status ? :
515 0 0 if ($oops_word) { }
548 0 0 if ($untrunc_token eq '#comm') { }
552 0 0 $untrunc_token eq '#reco' ? :
559 0 0 $status ? :
566 0 6 if ($flag and $addr == 0) { }
606 0 7 if length $token > $max
611 6 1 if (exists $$by_name{$token}) { }
625 1 0 if ($char =~ /[a-z]/) { }
0 0 elsif (ord $char < 97) { }
640 0 8 if (exists $$by_address{$address}) { }
651 0 8 if ($word eq $token) { }
656 0 8 if ($linear_search) { }
661 3 5 if ($delta_mult == -1) { }
670 1 7 if $delta == 0
673 0 8 if ($next < 0 or $next >= $num_words) { }
1 7 elsif ($next == $ahead or $next == $behind) { }
714 0 0 if ($what)
715 0 0 if ($player_object and $what =~ /^(me|self)$/i) { }
0 0 elsif ($current_room and $what =~ /^here$/) { }
729 0 0 if (do { $token eq 'rooms' }) { }
0 0 elsif ($token eq 'items') { }
0 0 elsif ($token eq '#serials') { }
0 0 elsif ($token eq 'systolic') { }
0 0 elsif ($token eq 'angiotensin') { }
0 0 elsif ($token eq 'lummox') { }
0 0 elsif ($token eq 'omap') { }
0 0 elsif ($token eq 'lingo') { }
0 0 elsif ($token eq 'embezzle') { }
0 0 elsif ($token =~ /#sgv/) { }
0 0 elsif ($token =~ /#slv/) { }
0 0 elsif ($token =~ /#ggv/) { }
0 0 elsif ($token =~ /#?teleport/) { }
0 0 elsif ($token eq 'baste' or $token eq 'nosh') { }
0 0 elsif ($token eq 'voluminus') { }
0 0 elsif ($token eq 'gmacho') { }
0 0 elsif ($token eq 'verdelivre') { }
0 0 elsif ($token eq 'vilify') { }
0 0 elsif ($token eq 'travis' or $token eq 'bickle') { }
0 0 elsif ($token =~ /^(frotz|futz|lumen)$/) { }
0 0 elsif ($token eq 'tail') { }
0 0 elsif ($token eq '#sa') { }
0 0 elsif ($token eq '#sp') { }
0 0 elsif ($token eq '#dta') { }
0 0 elsif ($token eq '#dat' or $token eq 'spiel') { }
0 0 elsif ($token eq '#sprop') { }
776 0 0 if ($self->version > 3) { }
0 0 elsif (Games::Rezrov::StoryFile::header()->is_time_game) { }
0 0 elsif (length $what) { }
781 0 0 if ($what =~ /^-?\d+$/) { }
835 0 0 $what ? :
836 0 0 if (@hits > 1) { }
0 0 elsif (@hits == 1) { }
0 0 elsif ($what) { }
0 0 elsif ($token eq 'pilfer') { }
0 0 elsif ($token eq 'bamf') { }
845 0 0 if ($token eq 'bamf') { }
0 0 elsif ($token eq 'pilfer') { }
849 0 0 if ($zstat->is_player) { }
0 0 elsif ($zstat->in_current_room) { }
852 0 0 if ($zstat->in_inventory) { }
0 0 elsif ($zstat->is_toplevel_child) { }
872 0 0 if (not $player_object && Games::Rezrov::StoryFile::current_room()) { }
0 0 elsif ($zstat->is_player) { }
0 0 elsif ($zstat->in_current_room) { }
875 0 0 if ($desc eq 'cretin') { }
881 0 0 if ($zstat->in_inventory) { }
0 0 elsif ($zstat->is_toplevel_child) { }
900 0 0 if ($proceed)
926 0 0 unless $just_one_newline
933 0 0 unless ($_[0]->object_cache)
948 0 0 if @messages == 1 or not defined $last_stamp or $index ne $last_stamp
958 0 0 if (@_ == 1) { }
0 0 elsif (@_ == 2) { }
971 1 3 unless ($self->dictionary_fully_decoded)
982 528 8 unless (exists $$by_address{$address})
1008 0 0 if ($what) { }
1012 0 0 if (Games::Rezrov::ZOptions::SHAMELESS())
1017 0 0 if length $copy > $token_len
1026 0 0 if (++$wrote % $fit) { }
1042 0 0 if ($type == 1) { }
1044 0 0 if ($what) { }
1046 0 0 if (@hits > 1) { }
0 0 elsif (@hits == 1) { }
1052 0 0 if (my $pr = $zstat->parent_room) { }
1072 0 0 if ($pid == 0 or not $objs{$pid})
1078 0 0 if exists $seen{$_}
1084 0 0 $type == 2 ? :
1101 0 0 unless $id
1103 0 0 if (defined $desc) { }
1104 0 0 if ($seen_ref)
1105 0 0 if exists $$seen_ref{$id}
1111 0 0 if $child and $child->object_id and $child->object_id <= $last
1114 0 0 unless ($no_sibs)
1117 0 0 if $sib and $sib->object_id and $sib->object_id <= $last
1132 0 0 if (not $where) { }
0 0 elsif (not $player_object) { }
1140 0 0 if (@hits == 1) { }
0 0 elsif (@item_hits == 1 and @hits == 0) { }
0 0 elsif (@hits > 1) { }
0 0 elsif (@item_hits > 1) { }
1145 0 0 if ($zstat->is_current_room) { }
1163 0 0 if ($zstat->parent_room) { }
1166 0 0 if ($zstat->is_current_room) { }
0 0 elsif ($zstat->is_player) { }
0 0 elsif ($zstat->is_toplevel_child) { }
1182 0 0 if ($proceed)
1232 0 0 unless @attributes
1235 0 0 if (not $what) { }
1241 0 0 if (@hits == 1) { }
0 0 elsif (@hits > 1) { }
1248 0 0 if ($zstat->is_player) { }
0 0 elsif ($zstat->in_inventory) { }
0 0 elsif ($zstat->in_current_room) { }
1253 0 0 if ($zstat->is_toplevel_child) { }
1265 0 0 if ($proceed)
1299 0 0 if (not $what) { }
1304 0 0 if (@hits == 1) { }
0 0 elsif (@hits > 1) { }
1308 0 0 if ($zstat->is_player) { }
0 0 elsif ($zstat->in_inventory) { }
0 0 elsif ($zstat->in_current_room) { }
1311 0 0 if ($zo->test_attr($property)) { }
1336 0 0 if (Games::Rezrov::StoryFile::is_this_game($rnum, $serial, $checksum))
1338 0 0 @stuff == 1 ? :
1342 0 0 scalar @list == 1 ? :
1348 0 0 if (my $title = Games::Rezrov::StoryFile::game_title())
1365 0 0 if (not $what) { }
1370 0 0 if (@hits == 1) { }
0 0 elsif (@hits > 1) { }
1377 0 0 if (my $parent = $zstat->parent_room) { }
1381 0 0 if ($zs2->in_current_room) { }
1387 0 0 if ($$target_desc =~ /^mr?s\. /i) { }
0 0 elsif ($$target_desc =~ /^mr\. /i) { }
1415 0 0 if (@stuff) { }
1418 0 0 if ($fvo =~ /infocom/i) { }
1440 0 0 if ($^O eq 'MSWin32') { }
1461 0 0 if ($key)
1463 0 0 if ($class)
1474 0 0 if ($key)
1476 0 0 if ($cmd =~ /%1/) { }
1488 0 0 if ($cmd)
1494 0 0 if ($cmd =~ /^([\"\'])/) { }
1497 0 0 unless $cmd =~ /$regexp/
1506 0 0 unless (Win32::Process::Create($pobj, $exe_name, $cmd_line, 0, NORMAL_PRIORITY_CLASS(), '.'))
1522 0 0 if (not $cmd or $exec_error)
1535 0 0 if (-x $fq)
1541 0 0 if $browser
1544 0 0 if ($browser and $ENV{'DISPLAY'}) { }
1549 0 0 if ($basename eq 'netscape' or $basename eq 'phoenix' or $basename eq 'firebird')
1555 0 0 $tried_remote ? :
0 0 if ($tried_remote ? $? : 1)
1576 0 0 if (@stuff == 3) { }
1578 0 0 if ($state) { }
1595 0 0 if (@stuff == 3) { }
1607 0 0 unless $what
1618 0 0 unless $start
1619 0 0 unless $min_words
1635 0 0 unless ($SHOW_LEVEL <= 1)
1640 0 0 if $_ == $after
1649 0 0 if ($$blob =~ /\s{2,}/)
1651 0 0 unless $$blob =~ /(\*{3,}|\x0d|\d\.\s+[A-Z])/
1657 0 0 if $$blob =~ /^\s*[a-z\d\'\-]+[A-Z]\w/
1667 0 0 if $$blob =~ /^\s*[A-Z\d]\w*[a-z]+[A-Z]/
1676 0 0 if $$blob =~ /^[a-z]+ [A-Z]/
1685 0 0 if ($$blob =~ /(?
1687 0 0 if ($$blob =~ /([\w\d]\.){2,}/) { }
1704 0 0 if /[A-Z][a-z]+/
1710 0 0 if $$blob =~ /\s\.(?!\.\.)/
1713 0 0 if $$blob =~ /\s,/
1720 0 0 if $$blob =~ /[\!\?]\w/
1730 0 0 if $$blob =~ /[a-z][A-Z]\s+/
1731 0 0 if $$blob =~ /\s[a-z]+[A-Z]/
1740 0 0 unless (@words >= $min_words)
1741 0 0 unless $$blob =~ /.+[\!\?\.\:]$/
1747 0 0 unless length $_
1753 0 0 if $_ eq '...'
1755 0 0 if /^[A-Z][a-z]+\.$/
1758 0 0 if /^[A-Z]\.$/
1761 0 0 if /^\(c\)$/i
1771 0 0 unless $_
1774 0 0 if /-/ and /^[\w-]+$/
1777 0 0 if /^\#?[\d,]+$/
1784 0 0 unless (/[aeiouy]/i)
1787 0 0 unless /[\.\#]/ or /^h?m{2,}$/i or /^\d+(rd|st|nd|th)$/ or m[^\d+/\d+]
1804 0 0 if /\w+\"\w+/
1807 0 0 if /([A-Z][a-z]+){3,}/
1809 0 0 if /[A-z]\d[A-z]/
1811 0 0 if (length $_ == 1) { }
0 0 elsif (length $_ > 24) { }
1812 0 0 unless /^[aio]$/i
1821 0 0 if (/^[aeiou]+$/i)
1822 0 0 unless $_ eq 'aa' or /^[MCLXVI]+$/
1833 0 0 if $$blob =~ /^[bcdfghjklmnpqrstvwxyz]+$/i
1840 0 0 unless ($bad)
1842 0 0 if (@hits)
1847 0 0 unless (/\.\s+[A-Z]/)
1851 0 0 if $p_all_ok
1855 0 0 if $$blob =~ /\".*\"/
1858 0 0 if $$blob =~ /^[A-Z].+\.$/
1861 0 0 if $$blob =~ /^[A-Z].*[\!\?\.\:\"]{1,3}$/
1869 0 0 unless ($bad)
1871 0 0 if @last_after > 5
1874 0 0 $SHOW_LEVEL == 4 ? :
0 0 $bad ? :
0 0 if ($bad ? $SHOW_LEVEL < 3 : ($SHOW_LEVEL == 4 ? $definitely_ok : 1))
1896 0 0 if ($definitely_ok)
1909 0 0 $now ? :
1910 0 0 $status ? :
1947 0 0 $zp->property_exists ? :
1981 0 0 unless $total_weight
1985 0 0 if (Games::Rezrov::StoryFile::get_global_var($total_weight) == $LOTSA_WEIGHT and Games::Rezrov::StoryFile::get_global_var($max_items) == $LOTSA_ITEMS) { }
2001 0 0 if (my($var, $value) = $self->support_check(@SUPPORTED_GAMES))
2014 0 0 if (my($var, $value) = $self->support_check(@SUPPORTED_GAMES))
2017 0 0 if ($data)
2022 0 0 if ($doses > 2) { }
2035 0 4 if ($ref)
2052 0 0 unless @attributes
2055 0 0 if (not $what) { }
2061 0 0 if (@hits == 1) { }
0 0 elsif (@hits > 1) { }
2069 0 0 if ($zstat->is_player) { }
0 0 elsif ($zstat->in_current_room) { }
2075 0 0 if ($zstat->in_inventory)
2082 0 0 if ($proceed)
2111 0 0 unless @attributes
2114 0 0 if (not $what) { }
2120 0 0 if (@hits == 1) { }
0 0 elsif (@hits > 1) { }
2128 0 0 if ($zstat->is_player) { }
0 0 elsif ($zstat->in_current_room) { }
2139 0 0 if ($proceed)
2214 2 4 if length $token > $encoded_length
2217 0 5 unless (length $word < 3 or exists $words{$token} or $word =~ /^#/)
2230 0 0 unless $j == $i
2233 0 0 if exists $words{$try}
2241 0 0 if length $regexp > $encoded_length
2249 0 0 if @h
2260 0 0 if exists $words{$try}
2270 0 0 if @hits
2274 0 0 if @{$_;}
2277 0 0 if ($word ne $new_word)
2282 0 0 if (length $new_word == $encoded_length)
2295 0 0 if (@hits == 1)
2297 0 0 if (index(lc $$desc, lc $new_word) == 0)
2328 0 4 if (@subs)
2332 0 0 if ($i > 0)
2334 0 0 if $i == $#subs
2351 0 0 unless ($what)
2366 0 0 unless @attributes
2373 0 0 unless (@hits == 1)
2374 0 0 unless $quiet
2380 0 0 unless ($what =~ / spell$/i)
2388 0 0 if (@hits == 1)
2396 0 0 if ($spell_attr)
2402 0 0 if ($usable) { }
2404 0 0 if ($parent and $parent->object_id == $spellbook_id) { }
2408 0 0 unless $quiet
2411 0 0 unless $quiet
2415 0 0 unless $quiet
2420 0 0 unless $found or $quiet
2441 0 0 unless @attributes
2444 0 0 if (not $what) { }
2450 0 0 if (@hits == 1) { }
0 0 elsif (@hits > 1) { }
2458 0 0 if ($zstat->is_player) { }
0 0 elsif ($zstat->in_current_room) { }
2461 0 0 if ($zo->test_attr($attr_container)) { }
2464 0 0 if ($zo->test_attr($attr_container_open)) { }
2477 0 0 if ($msg)
2482 0 0 if ($proceed)
2512 0 0 unless @attributes
2515 0 0 if (not $what) { }
2521 0 0 if (@hits == 1) { }
0 0 elsif (@hits > 1) { }
2529 0 0 if ($zstat->is_player) { }
0 0 elsif ($zstat->in_current_room) { }
2538 0 0 if ($msg)
2543 0 0 if ($proceed)
2572 0 0 unless @attributes
2577 0 0 if (@hits) { }
2580 0 0 unless $$ref[1] =~ / spell$/i
2584 0 0 if ($imported) { }