aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_monteCarlo.py4
-rw-r--r--tests/test_parseHelpers.py7
2 files changed, 9 insertions, 2 deletions
diff --git a/tests/test_monteCarlo.py b/tests/test_monteCarlo.py
index 283c657..b217cf9 100644
--- a/tests/test_monteCarlo.py
+++ b/tests/test_monteCarlo.py
@@ -14,8 +14,8 @@ class TestMonteCarlo(unittest.TestCase):
def testPickMove(self):
"""Test picking a move."""
state = GameState(TEST_BOARD_SIZE)
- tree = MCTS(state)
- print(tree.pickMove().toString())
+ tree = MCTS(state.lastMove)
+ #print(tree.pickMove().toString())
#def testSimulation(self):
# """Test calculation of group liberties."""
diff --git a/tests/test_parseHelpers.py b/tests/test_parseHelpers.py
index cf1fa9f..d03f253 100644
--- a/tests/test_parseHelpers.py
+++ b/tests/test_parseHelpers.py
@@ -20,6 +20,7 @@ class TestParseHelpers(unittest.TestCase):
self.assertEqual(parseHelpers.parseMove(["B", "A1", "W"], TEST_BOARD_SIZE),
parseHelpers.ParseCodes.ERROR)
+
parsedMove = parseHelpers.parseMove(["B", "t1"], TEST_BOARD_SIZE)
targetMove = parseHelpers.GtpMove(Player.BLACK, [18, 18])
@@ -67,6 +68,10 @@ class TestParseHelpers(unittest.TestCase):
"A19", TEST_BOARD_SIZE),
[0,0])
+ self.assertEqual(parseHelpers.parseVertex(
+ "pass", TEST_BOARD_SIZE),
+ "pass")
+
def testVertexToString(self):
"""Test converting vertices to strings."""
self.assertEqual(parseHelpers.vertexToString([0,0], TEST_BOARD_SIZE), "A19")
@@ -78,6 +83,8 @@ class TestParseHelpers(unittest.TestCase):
self.assertEqual(parseHelpers.vertexToString([18,0], TEST_BOARD_SIZE), "A1")
self.assertEqual(parseHelpers.vertexToString([18,18], TEST_BOARD_SIZE), "T1")
+ self.assertEqual(parseHelpers.vertexToString("pass", TEST_BOARD_SIZE), "pass")
+
self.assertEqual(parseHelpers.vertexToString([-1,0], TEST_BOARD_SIZE),
parseHelpers.ParseCodes.ERROR)
self.assertEqual(parseHelpers.vertexToString([0,-1], TEST_BOARD_SIZE),