Exemple #1
0
 def test_compute_polish_notation_float(self):
     s = '5.0 8 3 + /'
     self.assertIsInstance(compute_polish_notation(s), float)
Exemple #2
0
 def test_two_negative_element_in_expression(self):
     s = '-2 2 + -1 +'
     self.assertEqual(compute_polish_notation(s), -1)
Exemple #3
0
 def test_positive_element(self):
     s = '+2 2 *'
     self.assertEqual(compute_polish_notation(s), 4)
Exemple #4
0
 def test_first_negative_element(self):
     s = '-2 2 *'
     self.assertEqual(compute_polish_notation(s), -4)
Exemple #5
0
 def test_compute_polish_notation_as_integer(self):
     s = '5 8 3 + *'
     self.assertIsInstance(compute_polish_notation(s), int)