import unittest

from utils import run_file


class TestIfElif(unittest.TestCase):
    def test_po_if_elif_else(self):
        self.if_elif_else("PO")

    def test_co_if_elif_else(self):
        self.if_elif_else("CO")

    def if_elif_else(self, mode):
        self.assertTrue(run_file(["if_elif_else.alc", "primitives.alc"],
            ['-1', '10', '11', '0', '1', '0', '-100'],
            ["-1", "1", "1", "0", "1", "0", "-1"],
            mode))

    def test_po_if_elif(self):
        self.if_elif("PO")

    def test_co_if_elif(self):
        self.if_elif("CO")

    def if_elif(self, mode):
        self.assertTrue(run_file(["if_elif.alc", "primitives.alc"],
                                 ['-1', '10', '11', '0', '1', '0', '-100'],
                                 ["-1", "1", "1", "0", "1", "0", "-1"],
                                 mode))
