Example #1
0
def test_RPN_stack_underflow():
    inst = RPN()
    s = "1 +"
    assert inst.evaluate(s) == "Stack underflow" and inst.stack.items == []
Example #2
0
def test_RPN_evaluate():
    inst = RPN()
    s = "12 7 * 18 + 47 8 / - 3 +"
    assert inst.evaluate(s) == [99.125] and inst.stack.items == []
Example #3
0
def test_RPN_evaluate():
    inst = RPN()
    s = "12 7 * 18 + 47 8 / - 3 +"
    assert inst.evaluate(s) == [99.125] and inst.stack.items == []
Example #4
0
def test_RPN_stack_underflow():
    inst = RPN()
    s = "1 +"
    assert inst.evaluate(s) == "Stack underflow" and inst.stack.items == []