test_binary2decimal.py 487 B

123456789101112131415161718
  1. import unittest
  2. from utils import run_file
  3. class TestBinary2Decimal(unittest.TestCase):
  4. def test_po_binary2decimal(self):
  5. self.binary2decimal("PO")
  6. def test_co_binary2decimal(self):
  7. self.binary2decimal("CO")
  8. def binary2decimal(self, mode):
  9. self.assertTrue(run_file(["binary_to_decimal.alc", "primitives.alc"],
  10. ['"1"', '"10"', '"11"', '"100"', '"001"', '"1100111101"'],
  11. ["1", "2", "3", "4", "1", "829"],
  12. mode))