Condition Coverage

blib/lib/Chess/Game.pm
Criterion Covered Total %
condition 52 67 77.6


and 3 conditions

line !l l&&!r l&&r condition
277 0 3218 225 defined $new_piece and $new_piece->isa('Chess::Piece::King')
296 0 2978 225 defined $new_piece and $new_piece->isa('Chess::Piece::King')
499 0 0 4 defined $rook and not $rook->moved
534 1 0 2 defined $rook and not $rook->moved
574 3 367 1 defined $last_moved and $last_moved eq $player
367 3 0 not defined $last_moved and $player ne $player1
714 119 46 30 $validate and $piece->isa('Chess::Piece::Pawn')
734 103 33 27 $validate and $piece->isa('Chess::Piece::Pawn')
136 26 1 $validate and $piece->isa('Chess::Piece::Pawn') and _is_valid_en_passant($obj_data, $piece, $sq1, $sq2)
751 103 55 4 $validate and $piece->isa('Chess::Piece::King')
886 3 34 6 not $piece->isa('Chess::Piece::King') and $piece->captured
963 0 0 1 $self->player_checkmated($player) and $player eq $player2

or 2 conditions

line l !l condition
216 0 4 $p1 || 'white'
217 0 4 $p2 || 'black'

or 3 conditions

line l !l&&r !l&&!r condition
215 0 4 0 ref $caller || $caller
253 225 0 0 ref $self || croak('Invalid Chess::Game reference')
272 225 3218 157 $old_piece->isa('Chess::Piece::King') or not $old_piece->captured
291 225 2978 397 $old_piece->isa('Chess::Piece::King') or not $old_piece->captured
420 132 159 1821 $p1_piece->isa('Chess::Piece::King') or $p1_piece->captured
439 132 212 1768 $p2_piece->isa('Chess::Piece::King') or $p2_piece->captured
574 1 0 370 defined $last_moved and $last_moved eq $player or not defined $last_moved and $player ne $player1
602 43 1 17 'Chess::Board'->horz_distance($sq1, $sq2) == 0 or _is_valid_en_passant($obj_data, $piece, $sq1, $sq2)
755 1 1 160 $flags & 2 or $flags & 4