Add micro test for recursive type def
authorSiraaj Khandkar <siraaj@khandkar.net>
Sun, 16 Sep 2018 18:10:01 +0000 (14:10 -0400)
committerSiraaj Khandkar <siraaj@khandkar.net>
Sun, 16 Sep 2018 18:10:01 +0000 (14:10 -0400)
compiler/src/lib/tiger/tiger_test.ml
compiler/src/lib/tiger/tiger_test_cases.ml

index fe84ef8..038cd84 100644 (file)
@@ -233,7 +233,7 @@ let run tests =
         }
   in
   let test_case_count = ref 0 in
-  let col_1_width = 25 in
+  let col_1_width = 30 in
   let p_stat width (exe, out) =
     (* All this gymnastics to ignore color codes in cell width *)
     let min = 5 in
index 45a4e1d..8169083 100644 (file)
@@ -88,6 +88,16 @@ let micro =
         (* TODO: Be more specific *)
         ~is_error_expected_semant:(Some Error.is_wrong_type)
     )
+  ; ( Test.case
+        "Recursive type def: int list"
+        ~code:"\
+          let \n\
+            type intlist = {hd: int, tl: intlist} \n\
+            var lst : intlist := intlist {hd=0, tl = nil} \n\
+          in \n\
+            lst \n\
+          end"
+    )
   ]
 
 let book ~dir =
This page took 0.026767 seconds and 4 git commands to generate.