24 lines
619 B
Python
24 lines
619 B
Python
import pytest
|
|
|
|
import solution.ev2015 as solution
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def test_data_1() -> list[str]:
|
|
return ["(())", "(()(()(", ")())())"]
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def test_data_2() -> list[str]:
|
|
return [")", "()())"]
|
|
|
|
|
|
def test_day1_part1(test_data_1):
|
|
assert solution.day1(data=test_data_1[0], part=1) == 0
|
|
assert solution.day1(data=test_data_1[1], part=1) == 3
|
|
assert solution.day1(data=test_data_1[2], part=1) == -3
|
|
|
|
def test_day1_part2(test_data_2):
|
|
assert solution.day1(data=test_data_2[0], part=2) == 1
|
|
assert solution.day1(data=test_data_2[1], part=2) == 5
|