Anonymous avatar Anonymous committed b560d15

Added more tests.

Comments (0)

Files changed (1)

nurikabe-solver/t/verdict-matrix-tests.py.t

 from TAP.Simple import *
 from ctypes import *
 
-plan(17)
+plan(20)
 
 NK_SOLVE_ERROR__SUCCESS = 0
 NK_SOLVE_ERROR__ALLOC_FAILED = 1
 
     # TEST
     eq_ok (
-            m.set(3,4, NK_SOLVE_VERDICT__BLACK),
+            m.set(3,3, NK_SOLVE_VERDICT__BLACK),
             NK_SOLVE_ERROR__SUCCESS,
             "Set in coordinates is successful."
         )
 
     # TEST
     eq_ok (
+            m.get(3,3),
+            (NK_SOLVE_ERROR__SUCCESS, NK_SOLVE_VERDICT__BLACK),
+            "Get in (3,3) is black."
+        )
+
+    # TEST
+    eq_ok (
+            m.set(3,1, NK_SOLVE_VERDICT__WHITE),
+            NK_SOLVE_ERROR__SUCCESS,
+            "Set in (3,1) is successful."
+        )
+
+    # TEST
+    eq_ok (
+            m.get(3,2),
+            (NK_SOLVE_ERROR__SUCCESS, NK_SOLVE_VERDICT__UNKNOWN),
+            "Get (3,2) (which was not set)"
+        );
+
+    # TEST
+    eq_ok (
             m.get(3,4),
-            (NK_SOLVE_ERROR__SUCCESS, NK_SOLVE_VERDICT__BLACK),
-            "Get in (3,4) is black."
+            (NK_SOLVE_ERROR__SUCCESS, NK_SOLVE_VERDICT__UNKNOWN),
+            "Get in (3,4) is black. (2nd time)"
         )
 
     # TEST
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.