Advent-of-Code/2020/08/test_code.py
2020-12-08 11:20:43 +01:00

13 lines
377 B
Python

# SPDX-License-Identifier: MIT
# Copyright (c) 2020 Akumatic
from code import part1, part2
def test():
instructions = [["nop", "+0"], ["acc", "+1"], ["jmp", "+4"],
["acc", "+3"], ["jmp", "-3"], ["acc", "-99"], ["acc", "+1"], ["jmp", "-4"], ["acc", "+6"]]
assert(part1(instructions) == 5)
assert part2(instructions) == 8
if __name__ == "__main__":
test()