[board] Fix algebraic square parsing

I got very confused about which one is the rank and which one is the file. 🙃
This commit is contained in:
Eryn Wells 2023-12-23 09:27:56 -07:00
parent 9bcd0b2148
commit 341d8211ad
2 changed files with 32 additions and 31 deletions

View file

@ -114,12 +114,11 @@ mod tests {
fn has_piece_at() {
let bb = BitBoard(0b1001100);
assert!(bb.has_piece_at(
&Square::from_algebraic_string("a3").expect("Unable to get square for 'a3'")
));
assert!(!bb.has_piece_at(
&Square::from_algebraic_string("a2").expect("Unable to get square for 'a2'")
));
let c1 = Square::from_algebraic_string("c1").expect("Unable to get square for 'c1'");
assert!(bb.has_piece_at(&c1));
let b1 = Square::from_algebraic_string("b1").expect("Unable to get square for 'b1'");
assert!(!bb.has_piece_at(&b1));
}
#[test]