Board: add test for formatting

This commit is contained in:
Simon Gardling 2025-03-20 02:10:12 -04:00
parent 92b982cf35
commit 8b50273b43
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D

View File

@ -530,4 +530,31 @@ mod test {
assert_eq!(board.get((6, 0).into()), Some(Piece::Black), "\n{}", board);
}
#[test]
fn format_test() {
assert_eq!(
Board::new().starting_pos().to_string().as_str(),
" 7 6 5 4 3 2 1 0
-----------------
7| | | | | | | | |
-----------------
6| | | | | | | | |
-----------------
5| | | | | | | | |
-----------------
4| | | ||| | | |
-----------------
3| | | ||| | | |
-----------------
2| | | | | | | | |
-----------------
1| | | | | | | | |
-----------------
0| | | | | | | | |
-----------------
White Score: 2
Black Score: 2\n"
);
}
}