mirror of
https://github.com/bertptrs/adventofcode.git
synced 2025-12-25 21:00:31 +01:00
Super messy 2019 day 10
I accidentally inverted my y-axis and I'm not fixing it.
This commit is contained in:
86
2019/tests/test_day10.py
Normal file
86
2019/tests/test_day10.py
Normal file
@@ -0,0 +1,86 @@
|
||||
from io import StringIO
|
||||
from textwrap import dedent
|
||||
|
||||
import pytest
|
||||
|
||||
from aoc2019.day10 import part1, part2
|
||||
|
||||
LARGE_SAMPLE = """\
|
||||
.#..##.###...#######
|
||||
##.############..##.
|
||||
.#.######.########.#
|
||||
.###.#######.####.#.
|
||||
#####.##.#.##.###.##
|
||||
..#####..#.#########
|
||||
####################
|
||||
#.####....###.#.#.##
|
||||
##.#################
|
||||
#####.##.###..####..
|
||||
..######..##.#######
|
||||
####.##.####...##..#
|
||||
.#####..#.######.###
|
||||
##...#.##########...
|
||||
#.##########.#######
|
||||
.####.#.###.###.#.##
|
||||
....##.##.###..#####
|
||||
.#.#.###########.###
|
||||
#.#.#.#####.####.###
|
||||
###.##.####.##.#..##
|
||||
"""
|
||||
|
||||
|
||||
@pytest.mark.parametrize('visible,field', [
|
||||
(8, dedent("""\
|
||||
.#..#
|
||||
.....
|
||||
#####
|
||||
....#
|
||||
...##
|
||||
""")),
|
||||
(33, dedent("""\
|
||||
......#.#.
|
||||
#..#.#....
|
||||
..#######.
|
||||
.#.#.###..
|
||||
.#..#.....
|
||||
..#....#.#
|
||||
#..#....#.
|
||||
.##.#..###
|
||||
##...#..#.
|
||||
.#....####
|
||||
""")),
|
||||
(35, dedent("""\
|
||||
#.#...#.#.
|
||||
.###....#.
|
||||
.#....#...
|
||||
##.#.#.#.#
|
||||
....#.#.#.
|
||||
.##..###.#
|
||||
..#...##..
|
||||
..##....##
|
||||
......#...
|
||||
.####.###.
|
||||
""")),
|
||||
(41, dedent("""\
|
||||
.#..#..###
|
||||
####.###.#
|
||||
....###.#.
|
||||
..###.##.#
|
||||
##.##.#.#.
|
||||
....###..#
|
||||
..#.#..#.#
|
||||
#..#.#.###
|
||||
.##...##.#
|
||||
.....#.#..
|
||||
""")),
|
||||
(210, LARGE_SAMPLE),
|
||||
])
|
||||
def test_samples_part1(visible: int, field: str) -> None:
|
||||
data = StringIO(field.strip())
|
||||
assert part1(data) == visible
|
||||
|
||||
|
||||
def test_samples_part2():
|
||||
data = StringIO(LARGE_SAMPLE.strip())
|
||||
|
||||
assert part2(data) == 802
|
||||
Reference in New Issue
Block a user