chess-move-interface/tests/cmi_tests.cpp
2023-01-19 10:09:07 +01:00

23 lines
No EOL
404 B
C++

#include "CMI.hpp"
#include <catch_amalgamated.hpp>
using namespace CMI;
#define NEW_MOVE(VAR,SAN) HalfMove *(VAR)=new HalfMove(); (VAR)->SetSAN((SAN));
HalfMove *BuildTree(){
NEW_MOVE(m1,"e4");
NEW_MOVE(m2,"e5");
m1->SetMainline(m2);
return m1;
}
TEST_CASE("CMI Tests", "[valid]") {
HalfMove *m=BuildTree();
CHECK(m->GetNumber()==1);
CHECK(m->GetMainline()->GetNumber()==1);
}