import unittest

from utils import run_file


class TestFactorial(unittest.TestCase):
    def test_po_factorial(self):
        self.factorial("PO")

    def test_co_factorial(self):
        self.factorial("CO")

    def factorial(self, mode):
        self.assertTrue(run_file(["factorial.alc", "primitives.alc"],
            ['1', '2', '3', '4'],
            ["1", "2", "6", "24"],
            mode))
