day23 finished
This commit is contained in:
parent
f743a9636b
commit
db1d74d201
7 changed files with 299 additions and 0 deletions
40
advent/days/day23/test_solution.py
Normal file
40
advent/days/day23/test_solution.py
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
from advent.common import input
|
||||
|
||||
from .solution import Ground, day_num, part1, part2
|
||||
|
||||
|
||||
def test_part1():
|
||||
lines = input.read_lines(day_num, 'example01.txt')
|
||||
expected = 110
|
||||
result = part1(lines)
|
||||
assert result == expected
|
||||
|
||||
|
||||
def test_part2():
|
||||
lines = input.read_lines(day_num, 'example01.txt')
|
||||
expected = 20
|
||||
result = part2(lines)
|
||||
assert result == expected
|
||||
|
||||
|
||||
def test_round1():
|
||||
lines = input.read_lines(day_num, 'example02.txt')
|
||||
ground = Ground.parse(lines)
|
||||
expected = "##\n..\n#.\n.#\n#."
|
||||
ground.rounds(1)
|
||||
assert str(ground) == expected
|
||||
|
||||
|
||||
def test_round10():
|
||||
ground = Ground.parse(input.read_lines(day_num, 'example01.txt'))
|
||||
expected = Ground.parse(input.read_lines(day_num, 'expected01_10.txt'))
|
||||
ground.rounds(10)
|
||||
assert str(ground) == str(expected)
|
||||
|
||||
|
||||
def test_round2():
|
||||
lines = input.read_lines(day_num, 'example02.txt')
|
||||
ground = Ground.parse(lines)
|
||||
expected = ".##.\n#...\n...#\n....\n.#.."
|
||||
ground.rounds(2)
|
||||
assert str(ground) == expected
|
||||
Loading…
Add table
Add a link
Reference in a new issue