-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_day12.py
43 lines (34 loc) · 1.01 KB
/
test_day12.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
import unittest
import aoc
import day12
class TestDay12( unittest.TestCase ):
example_input = [
'initial state: #..#.#..##......###...###',
'',
'...## => #',
'..#.. => #',
'.#... => #',
'.#.#. => #',
'.#.## => #',
'.##.. => #',
'.#### => #',
'#.#.# => #',
'#.### => #',
'##.#. => #',
'##.## => #',
'###.. => #',
'###.# => #',
'####. => #'
]
def test_part1_example1( self ):
self.assertEqual( day12.part1( self.example_input ), 325 )
def test_part1_input( self ):
result = day12.part1( aoc.read_input( 'day12.input' ) )
self.assertEqual( result, 3472 )
def test_part2_example1( self ):
self.assertEqual( day12.part2( self.example_input ), 999999999374 )
def test_part2_input( self ):
result = day12.part2( aoc.read_input( 'day12.input' ) )
self.assertEqual( result, 2600000000919 )
if __name__ == '__main__':
unittest.main()