12345678910111213141516 |
- import unittest
-
- from gte.turmit import Turmit
- from gte.rpnlib import _op_list, RpnSymbol
-
- class RpnSymbolTestCase(unittest.TestCase):
-
- def test_operations(self):
- add_idx = list(_op_list.keys()).index('add')
-
- sym = RpnSymbol(add_idx, RpnSymbol.OPERATION)
- self.assertEqual(str(sym), 'ADD')
-
- def test_value(self):
- sym = RpnSymbol(42, RpnSymbol.VALUE)
- self.assertEqual(str(sym), '0x002A')
|