-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathday05_test.py
61 lines (49 loc) · 813 Bytes
/
day05_test.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
"""
Advent of Code 2024, Day 5: Print Queue.
See: https://adventofcode.com/2024/day/5
"""
import io
import pytest
from day05 import part_one, part_two
EXAMPLE = """\
47|53
97|13
97|61
97|47
75|29
61|13
75|53
29|13
97|29
53|29
61|53
97|53
61|29
47|13
75|47
97|75
47|61
75|61
47|29
75|13
53|13
75,47,61,53,29
97,61,53,29,13
75,29,13
75,97,47,61,53
61,13,29
97,13,75,29,47
"""
@pytest.fixture()
def example() -> str:
return EXAMPLE
def test_part_one(example: str) -> None:
"""
Test that checks if the solution for part one works on the example input.
"""
assert part_one(io.StringIO(example)) == 143
def test_part_two(example: str) -> None:
"""
Test that checks if the solution for part two works on the example input.
"""
assert part_two(io.StringIO(example)) == 123