def test_jump_true_opcode(): computer = Intcode([5, 1, 4, 99, 44], None) computer.jump_true_opcode(0, 0) if computer.pointer == 44: assert True else: assert False
def test_jump_true_fail(): computer = Intcode([5, 2, 0, 99], None) computer.jump_true_opcode(0, 0) if computer.pointer == 3: assert True else: assert False
def test_jump_true_fail_immediate(): computer = Intcode([5, 0, 33, 99], None) computer.jump_true_opcode(1, 1) if computer.pointer == 3: assert True else: assert False
def test_jump_true_opcode_immediate(): computer = Intcode([105, 1, 4, 99, 44], None) computer.jump_true_opcode(1, 1) if computer.pointer == 4: assert True else: assert False
def test_jump_true_fail_mixed_2(): computer = Intcode([5, 2, 0, 99], None) computer.jump_true_opcode(0, 1) print(computer.pointer) if computer.pointer == 3: assert True else: assert False