29 lines
954 B
Python
29 lines
954 B
Python
import pytest
|
|
|
|
from main import find_the_basement, process_input_string
|
|
|
|
|
|
@pytest.mark.parametrize('test_input, expected',
|
|
[
|
|
('(())', 0),
|
|
('()()', 0),
|
|
('(((', 3),
|
|
('(()(()(', 3),
|
|
('))(((((', 3),
|
|
('())', -1),
|
|
('))(', -1),
|
|
(')))', -3),
|
|
(')())())', -3)
|
|
])
|
|
def test_instruction_examples(test_input, expected):
|
|
assert process_input_string(test_input) == expected
|
|
|
|
|
|
@pytest.mark.parametrize('test_input, expected',
|
|
[
|
|
(')', 1),
|
|
('()())', 5)
|
|
])
|
|
def test_basement_instructions(test_input, expected):
|
|
assert find_the_basement(test_input) == expected
|