You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
668 B
26 lines
668 B
import unittest
|
|
import os
|
|
from . import comp
|
|
|
|
|
|
class Day5(unittest.TestCase):
|
|
def get_code(self):
|
|
inputfile = os.path.join(os.path.dirname(__file__), "input/day5_input")
|
|
with open(inputfile) as fp:
|
|
return [int(k) for k in fp.readline().split(',')]
|
|
|
|
def test_day5a(self):
|
|
outp = []
|
|
|
|
sut = comp.OpcodeComputer(self.get_code())
|
|
|
|
sut.process_op([1], outp)
|
|
self.assertEqual(int(outp[-1]), 8332629)
|
|
|
|
def test_day5b(self):
|
|
outp = []
|
|
|
|
sut = comp.OpcodeComputer(self.get_code())
|
|
|
|
sut.process_op([5], outp)
|
|
self.assertEqual(int(outp[-1]), 8805067)
|
|
|