day09 finished
This commit is contained in:
parent
a60707185f
commit
3629b81bcf
7 changed files with 2150 additions and 0 deletions
41
advent/days/day09/test_solution.py
Normal file
41
advent/days/day09/test_solution.py
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
from advent.common import utils
|
||||
|
||||
from .solution import Command, day_num, part1, part2
|
||||
|
||||
|
||||
def test_part1():
|
||||
data = utils.read_data(day_num, 'test01.txt')
|
||||
expected = 13
|
||||
result = part1(data)
|
||||
assert result == expected
|
||||
|
||||
|
||||
def test_part2():
|
||||
data = utils.read_data(day_num, 'test02.txt')
|
||||
expected = 36
|
||||
result = part2(data)
|
||||
assert result == expected
|
||||
|
||||
|
||||
def test_short():
|
||||
data = utils.read_data(day_num, 'test01.txt')
|
||||
expected = 13
|
||||
lst = [Command.parse(line) for line in data]
|
||||
result = Command.walk(lst, 2)
|
||||
assert result == expected
|
||||
|
||||
|
||||
def test_long1():
|
||||
data = utils.read_data(day_num, 'test01.txt')
|
||||
expected = 1
|
||||
lst = [Command.parse(line) for line in data]
|
||||
result = Command.walk(lst, 10)
|
||||
assert result == expected
|
||||
|
||||
|
||||
def test_long2():
|
||||
data = utils.read_data(day_num, 'test02.txt')
|
||||
expected = 36
|
||||
lst = [Command.parse(line) for line in data]
|
||||
result = Command.walk(lst, 10)
|
||||
assert result == expected
|
||||
Loading…
Add table
Add a link
Reference in a new issue