Genetic Turmit Evolver
python
c
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

test_rpnsymbol.py 438B

12345678910111213141516
  1. import unittest
  2. from gte.turmit import Turmit
  3. from gte.rpnlib import _op_list, RpnSymbol
  4. class RpnSymbolTestCase(unittest.TestCase):
  5. def test_operations(self):
  6. add_idx = list(_op_list.keys()).index('add')
  7. sym = RpnSymbol(add_idx, RpnSymbol.OPERATION)
  8. self.assertEqual(str(sym), 'ADD')
  9. def test_value(self):
  10. sym = RpnSymbol(42, RpnSymbol.VALUE)
  11. self.assertEqual(str(sym), '0x002A')