day04 finished
This commit is contained in:
parent
dc319ea862
commit
371bde9b7d
5 changed files with 1085 additions and 0 deletions
24
advent/days/day04/test_solution.py
Normal file
24
advent/days/day04/test_solution.py
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
from advent.common import utils
|
||||
|
||||
from .solution import Pair, Range, day_num, part1, part2
|
||||
|
||||
|
||||
def test_part1():
|
||||
data = utils.read_data(day_num, 'test01.txt')
|
||||
expected = 2
|
||||
result = part1(data)
|
||||
assert result == expected
|
||||
|
||||
|
||||
def test_part2():
|
||||
data = utils.read_data(day_num, 'test01.txt')
|
||||
expected = 4
|
||||
result = part2(data)
|
||||
assert result == expected
|
||||
|
||||
|
||||
def test_parse():
|
||||
input = "2-4,6-8"
|
||||
expected = Pair(Range(2, 4), Range(6, 8))
|
||||
result = Pair.parse(input)
|
||||
assert result == expected
|
||||
Loading…
Add table
Add a link
Reference in a new issue