import unittest

from utils import run_file


class TestBinary2Decimal(unittest.TestCase):
    def test_po_binary2decimal(self):
        self.binary2decimal("PO")

    def test_co_binary2decimal(self):
        self.binary2decimal("CO")

    def binary2decimal(self, mode):
        self.assertTrue(run_file(["binary_to_decimal.alc", "primitives.alc"],
            ["1", "10", "11", "100", "001", "1100111101"],
            [1, 2, 3, 4, 1, 829],
            mode))
