aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorthecharlesblake2018-01-08 18:57:33 +0000
committerthecharlesblake2018-01-08 18:57:33 +0000
commit02e332eb50cbf8115f28f3277c3938fe317fae65 (patch)
tree2e2c37bb988425bb33a0f061e24c44248a2de218 /src/test
parentAdd json rules for alpha star (diff)
downloadmetasol-02e332eb50cbf8115f28f3277c3938fe317fae65.tar.gz
metasol-02e332eb50cbf8115f28f3277c3938fe317fae65.zip

Add unit tests for alpha star

Diffstat (limited to 'src/test')
-rw-r--r--src/test/alpha_star_test.cpp28
-rw-r--r--src/test/resources/alpha_star/ComplexSolvable.json7
-rw-r--r--src/test/resources/alpha_star/ComplexUnsolvable.json7
-rw-r--r--src/test/resources/alpha_star/SimpleSolvable.json7
-rw-r--r--src/test/resources/alpha_star/SimpleUnsolvable.json7
5 files changed, 56 insertions, 0 deletions
diff --git a/src/test/alpha_star_test.cpp b/src/test/alpha_star_test.cpp
new file mode 100644
index 0000000..eeff1be
--- /dev/null
+++ b/src/test/alpha_star_test.cpp
@@ -0,0 +1,28 @@
+//
+// Created by thecharlesblake on 10/4/17.
+//
+
+#include <gtest/gtest.h>
+
+#include "test_helper.h"
+
+typedef test_helper th;
+
+const static std::string path = "resources/alpha_star/";
+const static std::string type = "simple-alpha-star";
+
+TEST(AlphaStar, SimpleSolvable) {
+ EXPECT_TRUE(th::is_solvable(path + "SimpleSolvable.json", type));
+}
+
+TEST(AlphaStar, ComplexSolvable) {
+ EXPECT_TRUE(th::is_solvable(path + "ComplexSolvable.json", type));
+}
+
+TEST(AlphaStar, SimpleUnsolvable) {
+ EXPECT_FALSE(th::is_solvable(path + "SimpleUnsolvable.json", type));
+}
+
+TEST(AlphaStar, ComplexUnsolvable) {
+ EXPECT_FALSE(th::is_solvable(path + "ComplexUnsolvable.json", type));
+}
diff --git a/src/test/resources/alpha_star/ComplexSolvable.json b/src/test/resources/alpha_star/ComplexSolvable.json
new file mode 100644
index 0000000..e7eedd5
--- /dev/null
+++ b/src/test/resources/alpha_star/ComplexSolvable.json
@@ -0,0 +1,7 @@
+{
+ "tableau piles": [
+ ["3S","2C","3C","5C","5H","4H"],
+ ["4S","4C","5S","2D","5D"],
+ ["2S","2H","3H","4D","3D"]
+ ]
+} \ No newline at end of file
diff --git a/src/test/resources/alpha_star/ComplexUnsolvable.json b/src/test/resources/alpha_star/ComplexUnsolvable.json
new file mode 100644
index 0000000..a01f2b5
--- /dev/null
+++ b/src/test/resources/alpha_star/ComplexUnsolvable.json
@@ -0,0 +1,7 @@
+{
+ "tableau piles": [
+ ["2S","2C","3C","5C","5H","4H"],
+ ["4S","4C","5S","2D","5D"],
+ ["3S","2H","3H","4D","3D"]
+ ]
+}
diff --git a/src/test/resources/alpha_star/SimpleSolvable.json b/src/test/resources/alpha_star/SimpleSolvable.json
new file mode 100644
index 0000000..d160e42
--- /dev/null
+++ b/src/test/resources/alpha_star/SimpleSolvable.json
@@ -0,0 +1,7 @@
+{
+ "tableau piles": [
+ ["5S","5C","4C","3C","2S","2C"],
+ ["5D","4D","3S","3D","2D"],
+ ["5H","4S","4H","3H","2H"]
+ ]
+}
diff --git a/src/test/resources/alpha_star/SimpleUnsolvable.json b/src/test/resources/alpha_star/SimpleUnsolvable.json
new file mode 100644
index 0000000..1097473
--- /dev/null
+++ b/src/test/resources/alpha_star/SimpleUnsolvable.json
@@ -0,0 +1,7 @@
+{
+ "tableau piles": [
+ ["2S","2C","3C","4C","5S","5C"],
+ ["2D","3D","4S","4D","5D"],
+ ["2H","3S","3H","4H","5H"]
+ ]
+} \ No newline at end of file