[position] Implement an assert_eq_bitboards! macro
This one helps with printing BitBoards if the assertion fails.
This commit is contained in:
parent
069f94e8c2
commit
20182d4035
1 changed files with 13 additions and 0 deletions
|
@ -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>;
|
pub type TestResult = Result<(), TestError>;
|
||||||
|
|
||||||
#[derive(Debug, Eq, PartialEq)]
|
#[derive(Debug, Eq, PartialEq)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue