Ejemplo n.º 1
0
 def test_functions(self):
     t = make_paired_tokens(scan("log(7)"))
     s = [['N', '*', '5'], ['N', '*', '7'], ['Z', '*', '']]
     self.assertEqual(t, s, 'problem with function calls')
Ejemplo n.º 2
0
 def test_comments(self):
     t = make_paired_tokens(scan("5 + 6 # + 56"))
     s = [['N', '*', '5'], ['N', '+', '6'], ['Z', '*', '']]
     self.assertEqual(t, s, 'problem with comments')
Ejemplo n.º 3
0
 def test_implied_multiplication(self):
     t = make_paired_tokens(scan("5 7"))
     s = [['N', '*', '5'], ['N', '*', '7'], ['Z', '*', '']]
     self.assertEqual(t, s, 'problem with implied multiplication')