Commits

ebo  committed 0d27bcd

Enhanced test for tail recursion elimination

  • Participants
  • Parent commits c38e7fd

Comments (0)

Files changed (1)

File test_pyvm.py

         fac = func()
         self.assertEqual(fac(4), 24)
 
+        @topcompiler.compile
+        def fac2(i):
+            """
+let rec fac = fun i acc -> if i > 1 then
+        fac (i-1) (acc * i)
+    else
+        acc
+in fac i 1
+            """
+            pass
+
+        self.assertEqual(fac2(4), 24)
+
 
 class TestTOPCompiler(unittest.TestCase):
     def test_compile(self):