-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathday10_test.py
executable file
·62 lines (50 loc) · 1.66 KB
/
day10_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env python
from unittest import TestCase, main
from day10 import part1, part2, parse
class Day10TestCase(TestCase):
def test_part1_1(self):
grid = parse("../input_small.txt")
(x, y, count) = part1(grid)
self.assertEqual(x, 3)
self.assertEqual(y, 4)
self.assertEqual(count, 8)
def test_part1_2(self):
grid = parse("../input_small2.txt")
(x, y, count) = part1(grid)
self.assertEqual(x, 5)
self.assertEqual(y, 8)
self.assertEqual(count, 33)
def test_part1_3(self):
grid = parse("../input_small3.txt")
(x, y, count) = part1(grid)
self.assertEqual(x, 1)
self.assertEqual(y, 2)
self.assertEqual(count, 35)
def test_part1_4(self):
grid = parse("../input_small4.txt")
(x, y, count) = part1(grid)
self.assertEqual(x, 6)
self.assertEqual(y, 3)
self.assertEqual(count, 41)
def test_part1_5(self):
grid = parse("../input_small5.txt")
(x, y, count) = part1(grid)
self.assertEqual(x, 11)
self.assertEqual(y, 13)
self.assertEqual(count, 210)
def test_part1_main(self):
grid = parse("../input.txt")
(x, y, count) = part1(grid)
self.assertEqual(x, 11)
self.assertEqual(y, 11)
self.assertEqual(count, 221)
def test_part2_1(self):
grid = parse("../input_small5.txt")
magic_num = part2(grid)
self.assertEqual(magic_num, 802)
def test_part2_main(self):
grid = parse("../input.txt")
magic_num = part2(grid)
self.assertEqual(806, magic_num)
if __name__ == "__main__":
main()