diff options
author | eug-vs <eugene@eug-vs.xyz> | 2023-02-23 13:40:39 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2023-02-23 14:01:19 +0300 |
commit | c299065952155a94c51fcf5398525dc858fdf8b5 (patch) | |
tree | c4e1b6745e995265cfb3d6f788b02a295aa4ebb1 /src/grossmeister | |
parent | 43dc24718c442ef45f6cecf5790df0ab84a72cfc (diff) | |
download | chessnost-c299065952155a94c51fcf5398525dc858fdf8b5.tar.gz |
fix: correct tests
Diffstat (limited to 'src/grossmeister')
-rw-r--r-- | src/grossmeister/evaluation.rs | 6 | ||||
-rw-r--r-- | src/grossmeister/move_generation.rs | 15 |
2 files changed, 11 insertions, 10 deletions
diff --git a/src/grossmeister/evaluation.rs b/src/grossmeister/evaluation.rs index 201aaed..61d375c 100644 --- a/src/grossmeister/evaluation.rs +++ b/src/grossmeister/evaluation.rs @@ -451,9 +451,9 @@ mod tests { let score2 = { let fen = String::from("r2q1rk1/pP1p2pp/Q4n2/bbp1p3/Np6/1B3NBn/pPPP1PPP/R3K2R b KQ - 0 1 "); - let mut board = Board::from_FEN(fen); - let gm = Grossmeister::new(board); - board.ply += 1; // TODO: remove me when FEN parsing includes side to move + let board = Board::from_FEN(fen); + let mut gm = Grossmeister::new(board); + gm.board.ply += 1; // TODO: remove me when FEN parsing includes side to move let score = gm.evaluate(); gm.board.print(); println!("Score {}", score); diff --git a/src/grossmeister/move_generation.rs b/src/grossmeister/move_generation.rs index c3acc91..ea40d18 100644 --- a/src/grossmeister/move_generation.rs +++ b/src/grossmeister/move_generation.rs @@ -242,15 +242,16 @@ mod tests { #[test] fn moved_king_castle() { let fen = String::from("4k2r/ppp1n3/8/4R1Pp/5P2/q1P5/P1P1BP2/1K1R4 b - - 2 22"); - let mut board = Board::from_FEN(fen); - board.ply += 1; - let gm = Grossmeister::new(board); + let board = Board::from_FEN(fen); + let mut gm = Grossmeister::new(board); + gm.board.ply += 1; // Shuffle kings around, returning to the same position - board.make_move(Move { source: Square::E8, target: Square::F8, kind: MoveKind::Quiet }); - board.make_move(Move { source: Square::B1, target: Square::A1, kind: MoveKind::Quiet }); - board.make_move(Move { source: Square::F8, target: Square::E8, kind: MoveKind::Quiet }); - board.make_move(Move { source: Square::A1, target: Square::B1, kind: MoveKind::Quiet }); + gm.board.make_move(Move { source: Square::E8, target: Square::F8, kind: MoveKind::Quiet }); + gm.board.make_move(Move { source: Square::B1, target: Square::A1, kind: MoveKind::Quiet }); + gm.board.make_move(Move { source: Square::F8, target: Square::E8, kind: MoveKind::Quiet }); + gm.board.make_move(Move { source: Square::A1, target: Square::B1, kind: MoveKind::Quiet }); + gm.board.print(); let moves = gm.generate_pseudolegal_moves(); |