File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1720,6 +1720,18 @@ def test_impossible_check_due_to_en_passant(self):
17201720 self .assertFalse (board .has_legal_en_passant ())
17211721 self .assertEqual (len (list (board .legal_moves )), 2 )
17221722
1723+ def test_multiple_kings (self ):
1724+ board = chess .Board ("KKKK1kkk/8/8/8/8/8/8/8 w - - 0 1" )
1725+ self .assertEqual (board .king (chess .WHITE ), None )
1726+
1727+ # https://github.com/niklasf/python-chess/issues/1169#issuecomment-3838025276
1728+ board = chess .Board (None )
1729+ board .set_piece_at (chess .A1 , chess .Piece (chess .ROOK , chess .WHITE ))
1730+ board .set_piece_at (chess .A8 , chess .Piece (chess .KING , chess .BLACK )) # attacked
1731+ board .set_piece_at (chess .H8 , chess .Piece (chess .KING , chess .BLACK )) # safe
1732+ board .turn = chess .WHITE
1733+ self .assertTrue (board .was_into_check ())
1734+
17231735
17241736class LegalMoveGeneratorTestCase (unittest .TestCase ):
17251737
You can’t perform that action at this time.
0 commit comments