from util import basic_operation_of_system_test, run_siso_program

prog = basic_operation_of_system_test()
output = run_siso_program(prog, 1)
print(output)
assert output == 2351176124

output = run_siso_program(prog, 2)
print(output)
assert output == 73110
Beispiel #2
0
def test_day5_test5():
    """Is 8 equal to 8? (immediate_mode)"""
    output_code= run_siso_program([3, 3, 1108, -1, 8, 3, 4, 3, 99], 8)
    assert output_code== 1
Beispiel #3
0
def test_day5_test6():
    """Is 3 less than 8? (immediate_mode)"""
    output_code = run_siso_program([3, 3, 1107, -1, 8, 3, 4, 3, 99], 3)
    assert output_code== 1
Beispiel #4
0
def test_day5_test3():
    """Is 1 equal to 8? (position_mode)"""
    output_code= run_siso_program([3, 9, 8, 9, 10, 9, 4, 9, 99, -1, 8], 1)
    assert output_code== 0
Beispiel #5
0
def test_day5_test4():
    """Is 9 less equal to 8? (position_mode)"""
    output_code= run_siso_program([3, 9, 7, 9, 10, 9, 4, 9, 99, -1, 8], 9)
    assert output_code== 0
Beispiel #6
0
def test_day5_test13():
    """Complicated check is greater than  8"""
    output_code = run_siso_program(p_larger, 200)
    assert output_code== 1001
Beispiel #7
0
def test_day5_test12():
    """Complicated check is equal to 8"""
    output_code = run_siso_program(p_larger, 8)
    assert output_code== 1000
Beispiel #8
0
def test_day5_test11():
    """Complicated check is less than 8"""
    output_code = run_siso_program(p_larger, 7)
    assert output_code== 999
Beispiel #9
0
def test_day5_test10():
    """Jump test nonzero? (immediate mode)"""
    p = [3,3,1105,-1,9,1101,0,0,12,4,12,99,1]
    inval = 999
    output_code = run_siso_program(p, inval)
    assert output_code== 1
Beispiel #10
0
def test_day5_test8():
    """Jump test nonzero? (position mode)"""
    p = [3,12,6,12,15,1,13,14,13,4,13,99,-1,0,1,9]
    inval = 999
    output_code = run_siso_program(p, inval)
    assert output_code== 1