diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2022-02-24 20:40:17 +0100 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2022-02-24 20:40:17 +0100 |
| commit | 3812a74cda452afd7e7c1f99f417fde87d233308 (patch) | |
| tree | b39b8351d9038c2df99086db08779af878afe50c | |
| parent | 90050da015f3988ab3188eb19629aed262454fef (diff) | |
Debug SAN move parser
| -rw-r--r-- | src/ChessArbiter.cpp | 1 | ||||
| -rw-r--r-- | tests/chessarbiter.cpp | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/ChessArbiter.cpp b/src/ChessArbiter.cpp index fe83662..400b011 100644 --- a/src/ChessArbiter.cpp +++ b/src/ChessArbiter.cpp @@ -435,6 +435,7 @@ std::string ChessArbiter::ParseSAN(std::string SANMove) { // Pawn moves if (std::islower(SANMove[0])) { piece = 'P'; + hint=SANMove[0]; // Not a capture if (SANMove[1] != 'x') { dst = SANMove.substr(0, 2); diff --git a/tests/chessarbiter.cpp b/tests/chessarbiter.cpp index 868ea2c..a6a3241 100644 --- a/tests/chessarbiter.cpp +++ b/tests/chessarbiter.cpp @@ -453,4 +453,7 @@ TEST_CASE("ParseSAN", "[ParseSAN]") { a.Setup("rnbqkbnr/pp3ppp/4p3/2pp4/3PP3/8/PPPN1PPP/R1BQKBNR w KQkq - 0 4"); CHECK(a.ParseSAN("exd5") == "e4d5"); + + a.Setup("1r4k1/4pp1p/6pb/1p3b2/P1P5/5P2/2P3PP/1K1R3R w - - 0 23"); + CHECK(a.ParseSAN("cxb5") == "c4b5"); } |
