@@ -994,7 +994,7 @@ def test_status(self):
994994
995995 # Triple check.
996996 board = chess .Board ("4k3/5P2/3N4/8/8/8/4R3/4K3 b - - 0 1" )
997- self .assertEqual (board .status (), chess .STATUS_TOO_MANY_CHECKERS )
997+ self .assertEqual (board .status (), chess .STATUS_TOO_MANY_CHECKERS | chess . STATUS_IMPOSSIBLE_CHECK )
998998
999999 # Impossible checker alignment.
10001000 board = chess .Board ("3R4/8/q4k2/2B5/1NK5/3b4/8/8 w - - 0 1" )
@@ -1675,6 +1675,14 @@ def test_king_captures_unmoved_rook(self):
16751675 board .push (move )
16761676 self .assertEqual (board .fen (), "8/8/8/B2p3Q/2qPp1P1/b7/2P2P1P/4K2k w - - 0 2" )
16771677
1678+ def test_impossible_check_due_to_en_passant (self ):
1679+ board = chess .Board ("rnbqk1nr/bb3p1p/1q2r3/2pPp3/3P4/7P/1PP1NpPP/R1BQKBNR w KQkq c6" )
1680+ self .assertEqual (board .status (), chess .STATUS_IMPOSSIBLE_CHECK )
1681+ self .assertEqual (board .ep_square , chess .C6 )
1682+ self .assertTrue (board .has_pseudo_legal_en_passant ())
1683+ self .assertFalse (board .has_legal_en_passant ())
1684+ self .assertEqual (len (list (board .legal_moves )), 2 )
1685+
16781686
16791687class LegalMoveGeneratorTestCase (unittest .TestCase ):
16801688
@@ -4279,7 +4287,7 @@ def test_legal_moves_after_end(self):
42794287 def test_racing_kings_status_with_check (self ):
42804288 board = chess .variant .RacingKingsBoard ("8/8/8/8/R7/8/krbnNB1K/qrbnNBRQ b - - 1 1" )
42814289 self .assertFalse (board .is_valid ())
4282- self .assertEqual (board .status (), chess .STATUS_RACE_CHECK | chess .STATUS_TOO_MANY_CHECKERS )
4290+ self .assertEqual (board .status (), chess .STATUS_RACE_CHECK | chess .STATUS_TOO_MANY_CHECKERS | chess . STATUS_IMPOSSIBLE_CHECK )
42834291
42844292
42854293class HordeTestCase (unittest .TestCase ):
0 commit comments