def test_run(): import pet_cpu machine_code = [ ("\x00\x01\x05\x13", 0x13), ("\x00\x01\x05\x02", 0x02), ("\x00\x01\x01\x01\x01\x02\x01\x03\x01\x02\x02\x05\x04", 0x02), ] for code, expected_result in machine_code: result = pet_cpu.run(code) if(result != expected_result): die(code + " failed.") ok("Executable running successful")
def run(program): pet_cpu.run(program)