From 284b3b68a0449af069c0c85661daf2b209f3b442 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sun, 14 Jan 2024 10:19:20 -0800 Subject: [PATCH] [board] Add another test to the position flags --- board/src/position/flags.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/board/src/position/flags.rs b/board/src/position/flags.rs index 2aa389d..7efc41d 100644 --- a/board/src/position/flags.rs +++ b/board/src/position/flags.rs @@ -69,5 +69,11 @@ mod tests { assert!(!flags.player_has_right_to_castle(Color::White, BoardSide::Queen)); assert!(flags.player_has_right_to_castle(Color::Black, BoardSide::King)); assert!(flags.player_has_right_to_castle(Color::Black, BoardSide::Queen)); + + flags.set_player_has_right_to_castle_flag(Color::White, BoardSide::Queen); + assert!(flags.player_has_right_to_castle(Color::White, BoardSide::King)); + assert!(flags.player_has_right_to_castle(Color::White, BoardSide::Queen)); + assert!(flags.player_has_right_to_castle(Color::Black, BoardSide::King)); + assert!(flags.player_has_right_to_castle(Color::Black, BoardSide::Queen)); } }