From 2238b6eecdf01cfce6dfbfc785c2a35850595f55 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Mon, 23 Jan 2023 14:10:44 +0300 Subject: test: add position perft --- src/board.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/board.rs b/src/board.rs index eea60fe..efe0b80 100644 --- a/src/board.rs +++ b/src/board.rs @@ -618,6 +618,15 @@ mod tests { // assert_eq!(board.perft(6, false), (119060324 , 2812008, 809099 , 5248)); } + #[test] + fn test_position_perft() { + let fen = String::from("r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq - "); + let mut board = Board::from_FEN(fen); + assert_eq!(board.perft(0, false), (1, 0, 0, 0)); + assert_eq!(board.perft(1, false), (48, 8, 0, 0)); + assert_eq!(board.perft(2, false), (2039, 351, 3, 1)); + } + #[test] fn test_is_square_attacked() { let board = Board::new(); -- cgit v1.2.3