mirror of
https://github.com/bertptrs/adventofcode.git
synced 2025-12-25 21:00:31 +01:00
Implement day 1
This commit is contained in:
6
2024/tests/samples/01.txt
Normal file
6
2024/tests/samples/01.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
3 4
|
||||
4 3
|
||||
2 5
|
||||
1 3
|
||||
3 9
|
||||
3 3
|
||||
14
2024/tests/test_day1.py
Normal file
14
2024/tests/test_day1.py
Normal file
@@ -0,0 +1,14 @@
|
||||
import os
|
||||
|
||||
from aoc.days.day1 import DayRunner
|
||||
|
||||
def get_data() -> str:
|
||||
sample = os.path.dirname(__file__) + "/samples/01.txt"
|
||||
with open(sample, mode="rt", encoding="utf-8") as f:
|
||||
return f.read()
|
||||
|
||||
def test_sample_part1():
|
||||
assert DayRunner.part1(get_data()) == 11
|
||||
|
||||
def test_sample_part2():
|
||||
assert DayRunner.part2(get_data()) == 31
|
||||
Reference in New Issue
Block a user