summaryrefslogtreecommitdiff
path: root/tests/test_board.py
diff options
context:
space:
mode:
authorAineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi>2024-01-14 14:13:59 +0200
committerAineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi>2024-01-14 14:13:59 +0200
commit2b98f7c66facfe71bf91aebc0d8cf3978e88303f (patch)
tree9f43a2aade7c26f6a541af09fdd058d67382d0ee /tests/test_board.py
parente56c2153add98361ea7909789b195d3a702f85bb (diff)
Making it possible to flag bombs and safe areas directly.
Diffstat (limited to 'tests/test_board.py')
-rw-r--r--tests/test_board.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/test_board.py b/tests/test_board.py
index 5fb36ad..82a2015 100644
--- a/tests/test_board.py
+++ b/tests/test_board.py
@@ -71,13 +71,17 @@ class TestBoardClass(unittest.TestCase):
self.assertEqual(b.get_mask(0,0), 13)
self.assertTrue(b.flag(0,0))
self.assertEqual(b.get_mask(0,0), 10)
+ self.assertTrue(b.flag(0,0,13))
+ self.assertEqual(b.get_mask(0,0), 13)
def test_flag_error_conditions(self):
""" liputus ei onnistu jos avattu, alueen ulkopuolella, outo arvo """
b = Board(2)
b.tiles=[[1,9],[9,9]]
- b.masked[0][0]=14
+ b.masked[0][0]=6
self.assertFalse(b.flag(0,0))
+ b.masked[0][0]=10
+ self.assertFalse(b.flag(0,0,4))
b.masked[0][0]=0
self.assertFalse(b.flag(0,0))
self.assertFalse(b.flag(2,2))