示例#1
0
 def test_programming_praxis(self):
     expr = "19 2.14 + 4.5 2 4.3 / - *"
     expected = (19 + 2.14) * (4.5 - 2 / 4.3)
     result = rpn_calc_eval(expr, self.stack)
     self.assertEqual(result[-1], expected)
示例#2
0
 def test_empty_string(self):
     expr = ""
     self.assertEqual(rpn_calc_eval(expr, self.stack), self.stack)
示例#3
0
 def test_gibberish(self):
     expr = "sdofcsdovnsi sdonsdofsdfoin sdonc cc"
     self.assertEqual(rpn_calc_eval(expr, self.stack), self.stack)