added possibility to make moves from string (with tests)

This commit is contained in:
Karma Riuk
2025-02-16 12:44:58 +01:00
parent ecba8e3c6e
commit ebf5934909
3 changed files with 43 additions and 0 deletions

13
tests/move.cpp Normal file
View File

@ -0,0 +1,13 @@
#include "../src/model/board/board.hpp"
#include "lib.hpp"
int main() {
std::string str_move = "a2a3";
ASSERT_EQUALS(str_move, Move::from_string(str_move).to_string());
str_move = "b2f4";
ASSERT_EQUALS(str_move, Move::from_string(str_move).to_string());
str_move = "a2a1r";
ASSERT_EQUALS(str_move, Move::from_string(str_move).to_string());
}