diff options
Diffstat (limited to 'src/board')
-rw-r--r-- | src/board/engine.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/board/engine.rs b/src/board/engine.rs index 2aa8e28..ceee108 100644 --- a/src/board/engine.rs +++ b/src/board/engine.rs @@ -350,6 +350,16 @@ mod tests { } #[test] + fn endgame_perft() { + let fen = String::from("8/2p5/3p4/KP5r/1R3p1k/8/4P1P1/8 w - - "); + let mut board = Board::from_FEN(fen); + + assert_eq!(board.perft(1, false), PerftResult { leaf_nodes: 14, captures: 1, en_passants: 0, castles: 0 , checks: 2 }); + assert_eq!(board.perft(2, false), PerftResult { leaf_nodes: 191, captures: 14, en_passants: 0, castles: 0 , checks: 10 }); + // assert_eq!(board.perft(3, false), PerftResult { leaf_nodes: 2182, captures: 209, en_passants: 2, castles: 0 , checks: 267 }); + } + + #[test] fn material_advantage() { let board = Board::new(); assert_eq!(board.material_advantage(), 0.0, "Material advantage should be 0 at starting position"); |