1
0
Fork 0
mirror of https://github.com/Findus23/AdventOfCode2019.git synced 2024-08-27 19:52:12 +02:00

add day5 (part 1)

This commit is contained in:
Lukas Winkler 2019-12-05 19:48:19 +01:00
parent 353b96999b
commit 29e5c6d740
Signed by: lukas
GPG key ID: 54DE4D798D244853

21
python/5/test_day5.py Normal file
View file

@ -0,0 +1,21 @@
from day5 import run_intcode, decode_code, part1
def test_new_opcodes():
assert run_intcode([3, 0, 4, 0, 99], input=33) == ([33, 0, 4, 0, 99], [33])
def test_parameter_mode():
assert run_intcode([1002, 4, 3, 4, 33], input=None) == ([1002, 4, 3, 4, 99], [])
def test_negative_case():
assert run_intcode([1101, 100, -1, 4, 0], input=42) == ([1101, 100, -1, 4, 99], [])
def test_decode_code():
assert decode_code(1002) == (10, 2)
def test_part1():
assert part1() == [0, 0, 0, 0, 0, 0, 0, 0, 0, 7286649]