Branch Coverage

blib/lib/Games/Go/Referee.pm
Criterion Covered Total %
branch 89 238 37.3


line true false branch
50 1 1 if (ref $sgf_file eq 'Games::Go::SGF') { }
54 0 1 unless defined $sgf
60 0 2 if $sgf->HA
72 112 2 if (ref $node eq 'Games::Go::SGF::Node') { }
73 112 0 if (ismove($node) or issetup($node))
78 0 2 if (ref $node eq 'Games::Go::SGF::Variation')
92 0 0 unless $v == 0
125 0 0 if defined $debug and $debug =~ /0|1/
132 0 0 if defined $logfile
168 1 0 if (@_)
170 1 0 if ($format eq 'sgf' or $format eq 'gtp') { }
173 0 0 if defined $format
181 2 0 if ($value =~ /\d+/o and $value > 0) { }
193 0 0 if (@_)
196 0 0 if ($switch eq 'on')
200 0 0 if ($switch eq 'off')
212 0 0 unless checkmove($self, $ab)
213 0 0 if ($colour eq 'B' or $colour eq 'W') { }
226 0 0 if (',AB,AW,AE,' =~ /,($_),/)
239 0 0 if ($number =~ /[2-9]/o) { }
240 0 0 if ($$self{'_const'}{'hfree'}) { }
243 0 0 if ($$self{'_const'}{'size'} == 18)
245 0 0 if $number % 2 == 0
261 0 0 if $$self{'_debug'}
263 0 0 $res ? :
274 0 0 if ($$self{'_cellfarm'}{$x . ',' . $y} eq '.')
276 0 0 unless play($self, $colour, $point)
292 0 0 if ($$self{'_cellfarm'}{$x . ',' . $y} eq '.')
294 0 0 if play($self, $colour, $point)
310 0 0 if ($$self{'_cellfarm'}{$x . ',' . $y} eq '.')
311 0 0 unless play($self, $colour, insertpoints($self, $x, $y))
313 0 0 if $exit
327 0 0 if ($capsref)
331 0 0 if $i == $#delstones
343 0 0 if abs $howmany > $$self{'_nodecount'}
344 0 0 if $howmany < 0
364 0 0 if $x == $size
388 0 0 unless defined $y
405 0 0 if defined $node
412 0 0 if $$self{'_debug'}
424 0 0 if ($_ > $upperB)
426 0 0 if defined $board
439 0 43320 unless defined $$self{'_cellfarm'}{$x . ',' . $y}
449 0 148 if ($what ne '.' and $$self{'_cellfarm'}{$where} ne '.') { }
468 0 0 unless (offboard($$self{'_const'}{'size'}, $x, $y))
470 0 0 if ($$self{'_cellfarm'}{$key} eq $c)
477 0 0 unless (exists $$group{"$xx,$yy"})
489 984 584 unless ($haslibs or offboard($$self{'_const'}{'size'}, $x, $y))
492 268 716 if ($cellcontents eq $c) { }
499 1036 36 unless (exists $$group{"$xx,$yy"})
514 84 112 $type eq 'self' ? :
521 32 500 if (keys %{$points;} and not $haslibs)
537 54 56 $colour eq 'W' ? :
540 0 110 if (defined $$self{'_coderef'})
542 0 0 if $$self{'_debug'}
545 4 106 if ($colour eq $$self{'_colour'} and $$self{'_const'}{'alternation'})
546 4 0 unless ($id <= $$self{'_const'}{'handicap'} and $$self{'_const'}{'hfree'})
548 0 4 if $$self{'_const'}{'exitonerror'}
553 6 104 if (ispass($self, $ab)) { }
557 2 102 if ($$self{'_passcount'} >= $$self{'_const'}{'passes'} and $$self{'_const'}{'passcount'})
559 0 2 if $$self{'_const'}{'exitonerror'}
564 0 104 if (offboard($size, $x, $y)) { }
566 0 0 if $$self{'_const'}{'exitonerror'}
568 0 104 if (put_cell($self, "$x,$y", $c))
570 0 0 if $$self{'_const'}{'exitonerror'}
575 4 100 if ($error)
577 0 4 if $$self{'_const'}{'exitonerror'}
579 30 74 if $captured
581 6 98 if (exists $$self{'_boardstr'}{$$board}) { }
582 0 6 if ($$self{'_const'}{'ssk'}) { }
584 0 0 if $$self{'_const'}{'exitonerror'}
587 0 6 if $$self{'_const'}{'exitonerror'}
593 0 104 if $$self{'_debug'}
594 0 104 if $$self{'_debug'}
607 6 2 if ($_ eq 'AW')
608 2 0 if ($_ eq 'AB')
614 0 8 if (offboard($size, $x, $y)) { }
617 0 8 if put_cell($self, "$x,$y", $c)
618 8 0 unless ($c eq '.')
620 2 6 if ($capturedSomething)
622 0 2 if $$self{'_const'}{'exitonerror'}
632 58 54 $c eq 'o' ? :
634 84 28 unless ($capturedsomething)
636 4 80 if $capturedsomething and not $$self{'_const'}{'selfcapture'}
652 110 136 if ($_ eq 'B' or $_ eq 'W')
653 0 110 unless move($self, $sgfnode->colour, $sgfnode->move)
656 4 132 if (',AB,AW,AE,' =~ /,($_),/)
659 0 8 if ($_ =~ /(..):(..)/) { }
690 0 0 $colour eq 'B' ? :
694 0 0 if ($$self{'_cellfarm'}{$x . ',' . $y} eq $stone)
713 0 0 $colour eq 'B' ? :
740 0 0 unless exists $$aliveref{$_}
762 110 2 testnode(shift(), ',B,W,') ? :
766 2 0 testnode(shift(), ',AB,AW,AE,') ? :
771 114 0 if ($sgfnode->tags)
773 112 158 if ($type =~ /,$_,/)
801 2 0 $rules ? :
802 0 2 if $rules =~ /^NZ|^NEW ZEALAND|^ING|^GOE/
803 0 2 if $rules =~ /^AGA/
804 0 2 if $rules =~ /^ING|^GOE/
805 2 0 if $rules =~ /^NZ|^NEW ZEALAND|^ING|^GOE|^CHINESE/
844 0 0 defined $ecode ? :
867 0 0 if $$self{'_debug'}
868 0 0 if ispass($self, $string)
869 0 0 if ($$self{'_const'}{'pointformat'} eq 'sgf') { }
878 222 0 if ($$self{'_const'}{'pointformat'} eq 'sgf') { }
879 4 218 unless defined $move
880 2 216 if ($move eq '' or $move eq 'tt' and $$self{'_const'}{'size'} < 19)
884 0 0 if ('pass' eq lc $move)
895 0 0 if (shift()) =~ /^[a-z]([1-9]\d?)$/i and 1 <= $1
911 0 112 if $pass
912 112 0 if ($$self{'_const'}{'pointformat'} eq 'sgf') { }
921 0 0 if ($$self{'_const'}{'pointformat'} eq 'sgf') { }
944 0 0 if $x eq '' and $y eq ''
949 0 0 if $_[0] eq '' and $_[1] eq ''
954 1130 88 unless 0 > $_[1] or $_[1] > $_[0] or 0 > $_[2]
958 0 0 $_[1] eq 'B' ? :
972 0 0 if (exists $messages[0])
973 0 0 unless open LOG, '>>', $$self{'_logfile'}