Exemplo n.º 1
0
def test_factorial(capfd):
    exec_file("examples/factorial.mi")
    out, _err = capfd.readouterr()
    assert out == "It's a 8 pieces o' eight\nIt's a 40320 pieces o' eight\n"
Exemplo n.º 2
0
def test_chromatic(capfd):
    exec_file("examples/chromatic.mi")
    out, _err = capfd.readouterr()
    assert out == "I'm carrying 0 bottles o' grog, green 1 pieces o' eight, blue 1 pieces o' eight, red red 0 pieces o' eight, green red 1 pieces o' eight, blue red 1 pieces o' eight.\n"
Exemplo n.º 3
0
def test_if(capfd):
    exec_file("examples/if.mi")
    out, _err = capfd.readouterr()
    assert out == "It's a 1 pieces o' eight\n"
Exemplo n.º 4
0
def test_closure(capfd):
    exec_file("examples/closure.mi")
    out, _err = capfd.readouterr()
    assert out == "It's a green 3 pieces o' eight\n"