[position] Clean up rook unit tests

Use test_position! instead of position!
Spell out the PlacedPiece constructor in the test_position! macro.
This commit is contained in:
Eryn Wells 2024-01-28 10:28:01 -08:00
parent ea74b214da
commit dab787170c
2 changed files with 14 additions and 7 deletions

View file

@ -22,7 +22,15 @@ macro_rules! test_position {
[$($color:ident $shape:ident on $square:ident),* $(,)?] => {
{
let pos = $crate::PositionBuilder::new()
$(.place_piece(piece!($color $shape on $square)))*
$(.place_piece(
chessfriend_core::PlacedPiece::new(
chessfriend_core::Piece::new(
chessfriend_core::Color::$color,
chessfriend_core::Shape::$shape
),
chessfriend_core::Square::$square
))
)*
.build();
println!("{pos}");
pos