aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt3
-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
6 files changed, 58 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f5c89ea..bd279c9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,7 +26,8 @@ set(sources_test src/test/test_helper.cpp
src/test/fortunes_favor_test.cpp
src/test/flower_garden_test.cpp
src/test/canfield_test.cpp
- src/test/somerset_test.cpp)
+ src/test/somerset_test.cpp
+ src/test/alpha_star_test.cpp)
###############################################################################
## Rapid JSON setup ###########################################################
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