2023-12-28 12:08:37 -07:00
|
|
|
// Eryn Wells <eryn@erynwells.me>
|
|
|
|
|
|
|
|
|
|
/// Test helper utilities.
|
|
|
|
|
use crate::Square;
|
|
|
|
|
|
|
|
|
|
/// A constructor function that returns a Square representing the square on the
|
|
|
|
|
/// chessboard indicated by the algebraic notation.
|
|
|
|
|
macro_rules! sq_constructor {
|
|
|
|
|
($func_name:ident) => {
|
|
|
|
|
pub(crate) fn $func_name() -> Square {
|
|
|
|
|
Square::from_algebraic_str(stringify!($func_name)).expect(stringify!($func_name))
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl Square {
|
2023-12-29 09:03:02 -08:00
|
|
|
sq_constructor!(d5);
|
2023-12-28 12:08:37 -07:00
|
|
|
sq_constructor!(e2);
|
|
|
|
|
sq_constructor!(e3);
|
|
|
|
|
sq_constructor!(e4);
|
2023-12-31 11:38:37 -08:00
|
|
|
sq_constructor!(e5);
|
2023-12-29 09:03:02 -08:00
|
|
|
sq_constructor!(f5);
|
2023-12-28 12:08:37 -07:00
|
|
|
}
|