Fix the pawn unit tests

This commit is contained in:
Eryn Wells 2024-02-25 10:51:27 -08:00
parent 63c03fb879
commit 2a6b098cb8
4 changed files with 112 additions and 45 deletions

View file

@ -3,7 +3,7 @@
use chessfriend_core::{Rank, Square};
/// En passant information.
#[derive(Clone, Copy, Debug)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct EnPassant {
target: Square,
capture: Square,
@ -39,10 +39,12 @@ impl EnPassant {
}
}
/// The square the capturing piece will move to.
pub fn target_square(&self) -> Square {
self.target
}
/// The square on which the captured pawn sits.
pub fn capture_square(&self) -> Square {
self.capture
}