Branch Coverage

blib/lib/Chess/Play.pm
Criterion Covered Total %
branch 0 504 0.0


line true false branch
115 0 0 if @fen_arr != 6
120 0 0 if @fen_rows != 8
141 0 0 if ($fen_2 eq 'w') { }
0 0 elsif ($fen_2 eq 'b') { }
153 0 0 if ($fen_3 =~ /K/) { }
159 0 0 if ($fen_3 =~ /Q/) { }
165 0 0 if ($fen_3 =~ /k/) { }
171 0 0 if ($fen_3 =~ /q/) { }
181 0 0 if ($fen_4 =~ /([a-h])3/) { }
0 0 elsif ($fen_4 =~ /([a-h])6/) { }
192 0 0 unless $fen_5 =~ /\d/
200 0 0 if ($self->can_capture_king(-$$self{'COLOR_TO_MOVE'})) { }
201 0 0 if ($$self{'COLOR_TO_MOVE'} == 1) { }
245 0 0 if ($$self{'COLOR_TO_MOVE'} == 1) { }
253 0 0 if $$self{'CASTLE_OK'}{'E1G1'}
254 0 0 if $$self{'CASTLE_OK'}{'E1C1'}
255 0 0 if $$self{'CASTLE_OK'}{'E8G8'}
256 0 0 if $$self{'CASTLE_OK'}{'E8C8'}
257 0 0 unless $fen_3
261 0 0 if ($$self{'LAST_DOUBLE_MOVE'}[$ldm])
262 0 0 if ($ldm < 8) { }
283 0 0 if $fen_piece eq ' '
285 0 0 if $fen_piece eq 'R'
286 0 0 if $fen_piece eq 'N'
287 0 0 if $fen_piece eq 'B'
288 0 0 if $fen_piece eq 'Q'
289 0 0 if $fen_piece eq 'K'
290 0 0 if $fen_piece eq 'P'
292 0 0 if $fen_piece eq 'r'
293 0 0 if $fen_piece eq 'n'
294 0 0 if $fen_piece eq 'b'
295 0 0 if $fen_piece eq 'q'
296 0 0 if $fen_piece eq 'k'
297 0 0 if $fen_piece eq 'p'
303 0 0 if @_ != 6
307 0 0 if ($p_val <= 0 or $p_val > 15 or ($n_val <= 0 or $n_val > 15) or ($b_val <= 0 or $b_val > 15) or ($r_val <= 0 or $r_val > 15) or ($q_val <= 0 or $q_val > 15))
341 0 0 unless ($move =~ /^[a-h][1-8][a-h][1-8](n|b|r|q)?$/)
348 0 0 if ($move eq $lm)
353 0 0 unless $is_legal
362 0 0 if ($self->insuff_material)
365 0 0 if ($self->rule50moves)
370 0 0 if (@legal_moves) { }
0 0 elsif ($$self{'UNDER_CHECK'}{'W_K'}) { }
0 0 elsif ($$self{'UNDER_CHECK'}{'B_K'}) { }
389 0 0 if ($$self{'DEPTH'} == 0) { }
433 0 0 if ($line eq 'xboard') { }
0 0 elsif ($line eq 'protover 2') { }
0 0 elsif ($line eq 'new') { }
0 0 elsif ($line eq 'force') { }
0 0 elsif ($line eq 'quit') { }
0 0 elsif ($line eq 'white') { }
0 0 elsif ($line eq 'black') { }
0 0 elsif ($line eq 'go') { }
0 0 elsif ($line =~ /[a-h][1-8][a-h][1-8]/) { }
462 0 0 if ($white_to_move) { }
473 0 0 unless ($first_move_done)
477 0 0 unless ($force)
479 0 0 if ($white_to_move) { }
513 0 0 if $$self{'BOARD'}[$sq] != 0
533 0 0 if ($count_material{'1'} + $count_material{'4'} + $count_material{'5'} == 0)
534 0 0 if $count_material{'3'} + $count_material{'2'} <= 1
536 0 0 if ($count_material{'-1'} + $count_material{'-4'} + $count_material{'-5'} == 0)
537 0 0 if $count_material{'-3'} + $count_material{'-2'} <= 1
547 0 0 if ($$self{'RULE_50_MOVES'} == 99)
565 0 0 if $$self{'BOARD'}[$dest_square] == 99
566 0 0 if ($val * $$self{'BOARD'}[$dest_square] <= 0)
585 0 0 if $$self{'BOARD'}[$dest_square] == 99
587 0 0 if $control > 0
588 0 0 if ($control <= 0)
591 0 0 if $control < 0
595 0 0 if $$self{'BOARD'}[$dest_square] == 99
597 0 0 if $control > 0
598 0 0 if ($control <= 0)
601 0 0 if $control < 0
605 0 0 if $$self{'BOARD'}[$dest_square] == 99
607 0 0 if $control > 0
608 0 0 if ($control <= 0)
611 0 0 if $control < 0
615 0 0 if $$self{'BOARD'}[$dest_square] == 99
617 0 0 if $control > 0
618 0 0 if ($control <= 0)
621 0 0 if $control < 0
638 0 0 if $$self{'BOARD'}[$dest_square] == 99
640 0 0 if $control > 0
641 0 0 if ($control <= 0)
644 0 0 if $control < 0
648 0 0 if $$self{'BOARD'}[$dest_square] == 99
650 0 0 if $control > 0
651 0 0 if ($control <= 0)
654 0 0 if $control < 0
658 0 0 if $$self{'BOARD'}[$dest_square] == 99
660 0 0 if $control > 0
661 0 0 if ($control <= 0)
664 0 0 if $control < 0
668 0 0 if $$self{'BOARD'}[$dest_square] == 99
670 0 0 if $control > 0
671 0 0 if ($control <= 0)
674 0 0 if $control < 0
701 0 0 if ($val > 0) { }
704 0 0 if ($$self{'BOARD'}[$dest_square] == 0)
705 0 0 if ($dest_square < 110) { }
717 0 0 if ($orig_square >= 38 and $orig_square <= 45)
719 0 0 if ($$self{'BOARD'}[$dest_square] == 0 and $$self{'BOARD'}[$dest_square - 12] == 0)
726 0 0 if ($$self{'BOARD'}[$dest_square] != 99 and $$self{'BOARD'}[$dest_square] < 0)
727 0 0 if ($dest_square < 110) { }
740 0 0 if ($$self{'BOARD'}[$dest_square] != 99 and $$self{'BOARD'}[$dest_square] < 0)
741 0 0 if ($dest_square < 110) { }
753 0 0 if ($orig_square >= 74 and $orig_square <= 81)
755 0 0 if ($column < 7)
756 0 0 if ($$self{'LAST_DOUBLE_MOVE'}[8 + $column + 1])
761 0 0 if ($column > 0)
762 0 0 if ($$self{'LAST_DOUBLE_MOVE'}[8 + $column - 1])
772 0 0 if ($$self{'BOARD'}[$dest_square] == 0)
773 0 0 if ($dest_square > 33) { }
785 0 0 if ($orig_square >= 98 and $orig_square <= 105)
787 0 0 if ($$self{'BOARD'}[$dest_square] == 0 and $$self{'BOARD'}[$dest_square + 12] == 0)
794 0 0 if ($$self{'BOARD'}[$dest_square] != 99 and $$self{'BOARD'}[$dest_square] > 0)
795 0 0 if ($dest_square > 33) { }
808 0 0 if ($$self{'BOARD'}[$dest_square] != 99 and $$self{'BOARD'}[$dest_square] > 0)
809 0 0 if ($dest_square > 33) { }
821 0 0 if ($orig_square >= 62 and $orig_square <= 69)
823 0 0 if ($column < 7)
824 0 0 if ($$self{'LAST_DOUBLE_MOVE'}[$column + 1])
829 0 0 if ($column > 0)
830 0 0 if ($$self{'LAST_DOUBLE_MOVE'}[$column - 1])
853 0 0 if $$self{'BOARD'}[$dest_square] == 99
854 0 0 if ($val * $$self{'BOARD'}[$dest_square] <= 0)
860 0 0 if ($val > 0) { }
861 0 0 if $$self{'UNDER_CHECK'}{'W_K'}
864 0 0 if ($$self{'CASTLE_OK'}{'E1G1'} and $$self{'BOARD'}[33] == 4 and $$self{'BOARD'}[31] == 0 and $$self{'BOARD'}[32] == 0)
872 0 0 if ($$self{'CASTLE_OK'}{'E1C1'} and $$self{'BOARD'}[26] == 4 and $$self{'BOARD'}[29] == 0 and $$self{'BOARD'}[28] == 0 and $$self{'BOARD'}[27] == 0)
882 0 0 if $$self{'UNDER_CHECK'}{'B_K'}
884 0 0 if ($$self{'CASTLE_OK'}{'E8G8'} and $$self{'BOARD'}[117] == -4 and $$self{'BOARD'}[115] == 0 and $$self{'BOARD'}[116] == 0)
893 0 0 if ($$self{'CASTLE_OK'}{'E8C8'} and $$self{'BOARD'}[110] == -4 and $$self{'BOARD'}[113] == 0 and $$self{'BOARD'}[112] == 0 and $$self{'BOARD'}[111] == 0)
918 0 0 if $square == 99
919 0 0 if $square == 0
920 0 0 if $control < 0
922 0 0 if $control == 1
923 0 0 if $control == 2
924 0 0 if $control == 3
925 0 0 if $control == 4
926 0 0 if $control == 5
927 0 0 if $control == 6
959 0 0 if ($self->test_legality($cm))
961 0 0 if ($$self{'BOARD'}[$orig_square] == 6) { }
0 0 elsif ($$self{'BOARD'}[$orig_square] == -6) { }
962 0 0 if ($cm eq '30 31') { }
0 0 elsif ($cm eq '30 32') { }
0 0 elsif ($cm eq '30 29') { }
0 0 elsif ($cm eq '30 28') { }
976 0 0 if ($cm eq '114 115') { }
0 0 elsif ($cm eq '114 116') { }
0 0 elsif ($cm eq '114 113') { }
0 0 elsif ($cm eq '114 112') { }
993 0 0 if not $flag{'WK_e1f1'} and $flag{'WK_e1g1'}
994 0 0 if not $flag{'WK_e1d1'} and $flag{'WK_e1c1'}
995 0 0 if not $flag{'BK_e8f8'} and $flag{'BK_e8g8'}
996 0 0 if not $flag{'BK_e8d8'} and $flag{'BK_e8c8'}
999 0 0 if $tmp_legal_moves{$tmp_move}
1014 0 0 if defined $squares[2]
1018 0 0 if $moving_color == -1
1021 0 0 if ($$self{'BOARD'}[$dest_square] != 0 or $moving_piece == 1 or $moving_piece == -1) { }
1031 0 0 if ($moving_piece == 6) { }
0 0 elsif ($moving_piece == -6) { }
1034 0 0 if ($dest_square - $orig_square == 2) { }
0 0 elsif ($dest_square - $orig_square == -2) { }
1046 0 0 if ($dest_square - $orig_square == 2) { }
0 0 elsif ($dest_square - $orig_square == -2) { }
1058 0 0 if ($moving_piece == 1) { }
0 0 elsif ($moving_piece == -1) { }
1059 0 0 if ($dest_square - $orig_square == 24) { }
0 0 elsif ($dest_square - $orig_square == 13 and $$self{'BOARD'}[$dest_square] == 0) { }
0 0 elsif ($dest_square - $orig_square == 11 and $$self{'BOARD'}[$dest_square] == 0) { }
1071 0 0 if ($promotion eq 'n') { }
0 0 elsif ($promotion eq 'b') { }
0 0 elsif ($promotion eq 'r') { }
0 0 elsif ($promotion eq 'q') { }
1085 0 0 if ($dest_square - $orig_square == -24) { }
0 0 elsif ($dest_square - $orig_square == -11 and $$self{'BOARD'}[$dest_square] == 0) { }
0 0 elsif ($dest_square - $orig_square == -13 and $$self{'BOARD'}[$dest_square] == 0) { }
1098 0 0 if ($promotion eq 'n') { }
0 0 elsif ($promotion eq 'b') { }
0 0 elsif ($promotion eq 'r') { }
0 0 elsif ($promotion eq 'q') { }
1113 0 0 if ($moving_piece == 4 and $orig_square == 33) { }
0 0 elsif ($moving_piece == 4 and $orig_square == 26) { }
0 0 elsif ($moving_piece == -4 and $orig_square == 117) { }
0 0 elsif ($moving_piece == -4 and $orig_square == 110) { }
1127 0 0 if ($dest_square == 33) { }
0 0 elsif ($dest_square == 26) { }
0 0 elsif ($dest_square == 117) { }
0 0 elsif ($dest_square == 110) { }
1141 0 0 unless $promotion
1143 0 0 if ($self->can_capture_king($moving_color)) { }
1144 0 0 if ($moving_color == 1) { }
1173 0 0 if ($color_to_move * $$self{'BOARD'}[$dest_square] == -6)
1204 0 0 if ($self->can_capture_king(-$moving_color))
1231 0 0 if $piece == 0 or $piece == 6 or $piece == -6
1241 0 0 if ($color == 1) { }
1243 0 0 if (not @legal_moves) { }
0 0 elsif ($self->rule50moves) { }
1244 0 0 if ($$self{'UNDER_CHECK'}{'B_K'}) { }
1260 0 0 if (not @legal_moves) { }
0 0 elsif ($self->rule50moves) { }
1261 0 0 if ($$self{'UNDER_CHECK'}{'W_K'}) { }
1281 0 0 if ($depth == 0)
1286 0 0 if ($color == 1) { }
1288 0 0 if (not @legal_moves) { }
1289 0 0 if ($$self{'UNDER_CHECK'}{'B_K'}) { }
1307 0 0 if $depth == $$self{'DEPTH'}
1323 0 0 if ($evaluation >= $beta)
1327 0 0 if ($evaluation > $alphaL)
1329 0 0 if ($depth == $$self{'DEPTH'})
1339 0 0 if (not @legal_moves) { }
1340 0 0 if ($$self{'UNDER_CHECK'}{'W_K'}) { }
1358 0 0 if $depth == $$self{'DEPTH'}
1373 0 0 if ($evaluation >= $beta)
1377 0 0 if ($evaluation > $alphaL)
1379 0 0 if ($depth == $$self{'DEPTH'})
1395 0 0 if ($self->insuff_material)
1399 0 0 if ($self->rule50moves)
1406 0 0 if (@legal_moves) { }
1407 0 0 if ($$self{'DEPTH'} == 0) { }
1419 0 0 if ($$self{'UNDER_CHECK'}{'W_K'}) { }
1433 0 0 if ($self->insuff_material)
1437 0 0 if ($self->rule50moves)
1444 0 0 if (@legal_moves) { }
1445 0 0 if ($$self{'DEPTH'} == 0) { }
1458 0 0 if ($$self{'UNDER_CHECK'}{'B_K'}) { }
1485 0 0 if ($engine_color eq 'W') { }
1488 0 0 if ($game_over) { }
1506 0 0 if $ok_move == -1
1507 0 0 if $ok_move == -2
1518 0 0 if $ok_move == -1
1519 0 0 if $ok_move == -2
1524 0 0 if ($game_over) { }
1572 0 0 if $value == 0
1573 0 0 if $value == 4
1574 0 0 if $value == -4
1575 0 0 if $value == 2
1576 0 0 if $value == -2
1577 0 0 if $value == 3
1578 0 0 if $value == -3
1579 0 0 if $value == 1
1580 0 0 if $value == -1
1581 0 0 if $value == 5
1582 0 0 if $value == -5
1583 0 0 if $value == 6
1584 0 0 if $value == -6
1595 0 0 if defined $squares[2]
1616 0 0 if length $coord == 5
1624 0 0 if $promotion