<filename>2019/day/2/part2/test_intcode.py
import pytest

from intcode import solve


@pytest.mark.parametrize('opcodes,solution', [
    ([1,0,0,0,99],[2,0,0,0,99]),
    ([2,3,0,3,99], [2,3,0,6,99]),
    ([2,4,4,5,99,0], [2,4,4,5,99,9801]),
    ([1,1,1,4,99,5,6,0,99], [30,1,1,4,2,5,6,0,99])
])
def test_solve(opcodes, solution):
    assert solve(opcodes) == solution

<filename>2019/day/2/part2/test_intcode.py
import pytest

from intcode import solve


@pytest.mark.parametrize('opcodes,solution', [
    ([1,0,0,0,99],[2,0,0,0,99]),
    ([2,3,0,3,99], [2,3,0,6,99]),
    ([2,4,4,5,99,0], [2,4,4,5,99,9801]),
    ([1,1,1,4,99,5,6,0,99], [30,1,1,4,2,5,6,0,99])
])
def test_solve(opcodes, solution):
    assert solve(opcodes) == solution
