[board] Implement a test_position macro that prints a Position after it builds it
Update the sight tests to use test_position! Remove a stray leftover mut. Clean up the test imports.
This commit is contained in:
parent
3c699b0b3d
commit
704ee2f425
2 changed files with 21 additions and 5 deletions
|
@ -18,3 +18,17 @@ macro_rules! position {
|
|||
.build()
|
||||
};
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[macro_export]
|
||||
macro_rules! test_position {
|
||||
[$($color:ident $shape:ident on $square:ident),* $(,)?] => {
|
||||
{
|
||||
let pos = $crate::PositionBuilder::new()
|
||||
$(.place_piece(piece!($color $shape on $square)))*
|
||||
.build();
|
||||
println!("{pos}");
|
||||
pos
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue