[board] Write test_position!({starting,empty}) macros

These produce starting and empty positions, respectively, and then print the
position.
This commit is contained in:
Eryn Wells 2024-01-28 09:47:25 -08:00
parent 66d03d3514
commit 6bd3787a24
2 changed files with 15 additions and 2 deletions

View file

@ -28,4 +28,18 @@ macro_rules! test_position {
pos
}
};
(empty) => {
{
let pos = Position::empty();
println!("{pos}");
pos
}
};
(starting) => {
{
let pos = Position::starting();
println!("{pos}");
pos
}
};
}

View file

@ -333,8 +333,7 @@ mod tests {
#[test]
fn piece_in_starting_position() {
let pos = Position::starting();
println!("{pos}");
let pos = test_position!(starting);
assert_eq!(
pos.piece_on_square(Square::H1),