Add perft testing links
All checks were successful
Python tests (make) / test (push) Successful in 10s

This commit is contained in:
2025-08-19 15:55:40 -04:00
parent f0a2087bdd
commit f6c796730e

View File

@@ -20,6 +20,7 @@ class TestLegalMoveGen(ChessLibTestBase):
def test_start_position(self): def test_start_position(self):
# 20 legal moves from the initial chess position # 20 legal moves from the initial chess position
# https://www.chessprogramming.org/Perft_Results#Initial_Position
fen = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1" fen = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"
b = Board() b = Board()
self.load_fen(fen, board=b) self.load_fen(fen, board=b)
@@ -30,7 +31,7 @@ class TestLegalMoveGen(ChessLibTestBase):
def test_kiwipete_depth1_count(self): def test_kiwipete_depth1_count(self):
# Kiwipete: perft(1) = 48 # Kiwipete: perft(1) = 48
# position 2: https://www.chessprogramming.org/Perft_Results # https://www.chessprogramming.org/Perft_Results#Position_2
fen = "r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq - 0 1" fen = "r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq - 0 1"
b = Board(); self.load_fen(fen, board=b) b = Board(); self.load_fen(fen, board=b)
@@ -39,6 +40,7 @@ class TestLegalMoveGen(ChessLibTestBase):
def test_perft_position_3(self): def test_perft_position_3(self):
# https://www.chessprogramming.org/Perft_Results#Position_3
fen = "8/2p5/3p4/KP5r/1R3p1k/8/4P1P1/8 w - - 0 1" fen = "8/2p5/3p4/KP5r/1R3p1k/8/4P1P1/8 w - - 0 1"
b = Board(); self.load_fen(fen, board=b) b = Board(); self.load_fen(fen, board=b)
@@ -47,6 +49,7 @@ class TestLegalMoveGen(ChessLibTestBase):
def test_perft_position_4(self): def test_perft_position_4(self):
# https://www.chessprogramming.org/Perft_Results#Position_4
fen = "r3k2r/Pppp1ppp/1b3nbN/nP6/BBP1P3/q4N2/Pp1P2PP/R2Q1RK1 w kq - 0 1" fen = "r3k2r/Pppp1ppp/1b3nbN/nP6/BBP1P3/q4N2/Pp1P2PP/R2Q1RK1 w kq - 0 1"
b = Board(); self.load_fen(fen, board=b) b = Board(); self.load_fen(fen, board=b)
@@ -55,6 +58,7 @@ class TestLegalMoveGen(ChessLibTestBase):
def test_perft_position_5(self): def test_perft_position_5(self):
# https://www.chessprogramming.org/Perft_Results#Position_5
fen = "rnbq1k1r/pp1Pbppp/2p5/8/2B5/8/PPP1NnPP/RNBQK2R w KQ - 1 8" fen = "rnbq1k1r/pp1Pbppp/2p5/8/2B5/8/PPP1NnPP/RNBQK2R w KQ - 1 8"
b = Board(); self.load_fen(fen, board=b) b = Board(); self.load_fen(fen, board=b)
@@ -63,6 +67,7 @@ class TestLegalMoveGen(ChessLibTestBase):
def test_perft_position_6(self): def test_perft_position_6(self):
# https://www.chessprogramming.org/Perft_Results#Position_6
fen = "r4rk1/1pp1qppp/p1np1n2/2b1p1B1/2B1P1b1/P1NP1N2/1PP1QPPP/R4RK1 w - - 0 10" fen = "r4rk1/1pp1qppp/p1np1n2/2b1p1B1/2B1P1b1/P1NP1N2/1PP1QPPP/R4RK1 w - - 0 10"
b = Board(); self.load_fen(fen, board=b) b = Board(); self.load_fen(fen, board=b)