mirror of
https://github.com/bertptrs/adventofcode.git
synced 2025-12-25 21:00:31 +01:00
Implement 2019 day 9
This commit is contained in:
@@ -64,3 +64,18 @@ def test_day5_example(inputs: int, expected: int):
|
||||
computer.run()
|
||||
|
||||
assert computer.output.pop() == expected
|
||||
|
||||
|
||||
@pytest.mark.parametrize('program,output', [
|
||||
([109, 1, 204, -1, 1001, 100, 1, 100, 1008, 100, 16, 101, 1006, 101, 0, 99],
|
||||
[109, 1, 204, -1, 1001, 100, 1, 100, 1008, 100, 16, 101, 1006, 101, 0, 99]),
|
||||
([1102, 34915192, 34915192, 7, 4, 7, 99, 0], [1219070632396864]),
|
||||
([104, 1125899906842624, 99], [1125899906842624]),
|
||||
])
|
||||
def test_instructions_day9(program: List[int], output: List[int]) -> None:
|
||||
computer = Computer(program)
|
||||
computer.run()
|
||||
|
||||
result = list(computer.output)
|
||||
|
||||
assert result == output
|
||||
|
||||
Reference in New Issue
Block a user