mirror of
https://gitlab.com/manzerbredes/chessarbiter.git
synced 2025-04-05 17:46:26 +02:00
Debug SANParser
This commit is contained in:
parent
8b499044fd
commit
975ad849d1
2 changed files with 6 additions and 5 deletions
|
@ -430,11 +430,7 @@ std::string ChessArbiter::ParseSAN(std::string SANMove) {
|
|||
if (SANMove.size() > 0) {
|
||||
// Pawn moves
|
||||
if (std::islower(SANMove[0])) {
|
||||
if (fen.player) {
|
||||
piece = 'p';
|
||||
} else {
|
||||
piece = 'P';
|
||||
}
|
||||
piece = 'P';
|
||||
// Not a capture
|
||||
if (SANMove[1] != 'x') {
|
||||
dst = SANMove.substr(0, 2);
|
||||
|
|
|
@ -445,4 +445,9 @@ TEST_CASE("ParseSAN", "[ParseSAN]") {
|
|||
CHECK(a.ParseSAN("O-O") == "e8g8");
|
||||
a.Setup("r3kb1r/pppppppp/2qnbn2/8/8/2NBQ3/PPPPPPPP/R3KBNR b KQkq - 0 1");
|
||||
CHECK(a.ParseSAN("O-O-O") == "e8c8");
|
||||
|
||||
// Random tests
|
||||
a.Setup(
|
||||
"r1bq1rk1/p4ppp/2p2n2/1pbPp3/3n4/P1NB3P/1PPP1PPN/R1BQ1RK1 b - - 0 10");
|
||||
CHECK(a.ParseSAN("exd5") == "c6d5");
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue