1234567891011121314151617181920 |
- 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), '0x2A')
-
- def test_op(self):
- sym = RpnSymbol(0, RpnSymbol.OPERATION)
- self.assertEqual(str(sym), 'MEM_SZ')
|