diff options
Diffstat (limited to 'src/board.rs')
-rw-r--r-- | src/board.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/board.rs b/src/board.rs index eea60fe..efe0b80 100644 --- a/src/board.rs +++ b/src/board.rs @@ -619,6 +619,15 @@ mod tests { } #[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(); |