aboutsummaryrefslogtreecommitdiff
path: root/tests/cmi_tests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cmi_tests.cpp')
-rw-r--r--tests/cmi_tests.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/cmi_tests.cpp b/tests/cmi_tests.cpp
new file mode 100644
index 0000000..1c84c40
--- /dev/null
+++ b/tests/cmi_tests.cpp
@@ -0,0 +1,23 @@
+#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);
+
+} \ No newline at end of file