Skip to content

Commit

Permalink
Add another SAN disambiguation test (niklasf/shakmaty#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasf committed Jul 10, 2024
1 parent 95803fc commit 474c87b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,11 @@ def test_san(self):
self.assertEqual(board.san(chess.Move.from_uci("h4g6")), "Nh4g6")
self.assertEqual(board.fen(), fen)

# Test a bug where shakmaty used overly specific disambiguation.
fen = "8/2KN1p2/5p2/3N1B1k/5PNp/7P/7P/8 w - -"
board = chess.Board(fen)
self.assertEqual(board.san(chess.Move.from_uci("d5f6")), "N5xf6#")

# Do not disambiguate illegal alternatives.
fen = "8/8/8/R2nkn2/8/8/2K5/8 b - - 0 1"
board = chess.Board(fen)
Expand Down

0 comments on commit 474c87b

Please sign in to comment.