Solve day 1
This commit is contained in:
37
01/puzzle_test.py
Normal file
37
01/puzzle_test.py
Normal file
@@ -0,0 +1,37 @@
|
||||
from puzzle import (
|
||||
pt_1_first_digit_pattern,
|
||||
pt_1_last_digit_pattern,
|
||||
solve_pt_1,
|
||||
solve_pt_2,
|
||||
)
|
||||
|
||||
|
||||
def test_solve_pt_1():
|
||||
assert (
|
||||
solve_pt_1(
|
||||
[
|
||||
"1abc2",
|
||||
"pqr3stu8vwx",
|
||||
"a1b2c3d4e5f",
|
||||
"treb7uchet",
|
||||
]
|
||||
)
|
||||
== 142
|
||||
)
|
||||
|
||||
|
||||
def test_solve_pt_2():
|
||||
assert (
|
||||
solve_pt_2(
|
||||
[
|
||||
"two1nine",
|
||||
"eightwothree",
|
||||
"abcone2threexyz",
|
||||
"xtwone3four",
|
||||
"4nineeightseven2",
|
||||
"zoneight234",
|
||||
"7pqrstsixteen",
|
||||
]
|
||||
)
|
||||
== 281
|
||||
)
|
Reference in New Issue
Block a user