test_if_elif.py 857 B

123456789101112131415161718192021222324252627282930
  1. import unittest
  2. from utils import run_file
  3. class TestIfElif(unittest.TestCase):
  4. def test_po_if_elif_else(self):
  5. self.if_elif_else("PO")
  6. def test_co_if_elif_else(self):
  7. self.if_elif_else("CO")
  8. def if_elif_else(self, mode):
  9. self.assertTrue(run_file(["if_elif_else.alc", "primitives.alc"],
  10. ['-1', '10', '11', '0', '1', '0', '-100'],
  11. ["-1", "1", "1", "0", "1", "0", "-1"],
  12. mode))
  13. def test_po_if_elif(self):
  14. self.if_elif("PO")
  15. def test_co_if_elif(self):
  16. self.if_elif("CO")
  17. def if_elif(self, mode):
  18. self.assertTrue(run_file(["if_elif.alc", "primitives.alc"],
  19. ['-1', '10', '11', '0', '1', '0', '-100'],
  20. ["-1", "1", "1", "0", "1", "0", "-1"],
  21. mode))