summaryrefslogtreecommitdiffstats
path: root/day12/test_init.py
diff options
context:
space:
mode:
authorGravatar Tom van der Lee <t0m.vd.l33@gmail.com>2022-12-12 10:49:04 +0100
committerGravatar Tom van der Lee <t0m.vd.l33@gmail.com>2022-12-12 10:49:04 +0100
commit126a628b171e2a7d2490290185ab21990b0d9698 (patch)
treebce90696bbc1ed94f96f162f141e36b61a13b5b5 /day12/test_init.py
parent0af1b042a29811bc5c850267681dc45469981845 (diff)
download2022-126a628b171e2a7d2490290185ab21990b0d9698.tar.gz
2022-126a628b171e2a7d2490290185ab21990b0d9698.tar.bz2
2022-126a628b171e2a7d2490290185ab21990b0d9698.zip
Day12 [Wip]
Diffstat (limited to 'day12/test_init.py')
-rw-r--r--day12/test_init.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/day12/test_init.py b/day12/test_init.py
new file mode 100644
index 0000000..f721d56
--- /dev/null
+++ b/day12/test_init.py
@@ -0,0 +1,27 @@
1# -*- coding: utf-8 -*-
2from day12 import Map
3
4
5class TestMap:
6 def test_neighbours(self):
7
8 map_input = ["".join([str(i) for i in range(8)]) for _ in range(5)]
9
10 map = Map(map=map_input)
11
12 assert set(map.neighbours(0, 0)) == {
13 (0, 1),
14 (1, 0),
15 }
16
17 assert set(map.neighbours(0, 4)) == {
18 (0, 3),
19 (1, 4),
20 }
21
22 assert set(map.neighbours(1, 1)) == {
23 (0, 1),
24 (1, 0),
25 (1, 2),
26 (2, 1),
27 }