Found f1b5 as a legal move
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: InvalidSanMove', src\main.rs:28:63
fn test() {
let move_string = "f1b5";
let board_string: &str = "rnbqkbnr/p1pppppp/8/1p6/4P3/8/PPPP1PPP/RNBQKBNR w KQkq - 0 1";
let board = Board::from_str(board_string).unwrap();
let legal_moves = MoveGen::new_legal(&board);
for legal in legal_moves {
if legal.to_string() == move_string {
println!("Found {} as a legal move", move_string);
}
}
let chess_move = ChessMove::from_san(&board, move_string).unwrap();
}
You can see that f1b5 is listed as a valid move and yet, from_san() returns an Err.
This test fails with
You can see that
f1b5
is listed as a valid move and yet,from_san()
returns anErr
.