Board: add test for formatting
This commit is contained in:
parent
92b982cf35
commit
8b50273b43
@ -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"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user