From 20182d4035e23a93f3ba7e3c125f75ef6a7b6280 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Fri, 8 Mar 2024 08:08:52 -0800 Subject: [PATCH] [position] Implement an assert_eq_bitboards! macro This one helps with printing BitBoards if the assertion fails. --- position/src/testing.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/position/src/testing.rs b/position/src/testing.rs index 1693110..12400bc 100644 --- a/position/src/testing.rs +++ b/position/src/testing.rs @@ -36,6 +36,19 @@ macro_rules! formatted_move_list { }; } +#[macro_export] +macro_rules! assert_eq_bitboards { + ($result:expr, $expected:expr) => {{ + let result = $result; + let expected = $expected; + assert_eq!( + result, expected, + "Result:\n{}\nExpected:\n{}", + result, expected + ); + }}; +} + pub type TestResult = Result<(), TestError>; #[derive(Debug, Eq, PartialEq)]