From: Siraaj Khandkar Date: Sun, 16 Sep 2018 18:10:01 +0000 (-0400) Subject: Add micro test for recursive type def X-Git-Url: https://git.xandkar.net/?p=tiger.ml.git;a=commitdiff_plain;h=d5517328dcf93c5bd74f1895262e47b70d2e4313 Add micro test for recursive type def --- diff --git a/compiler/src/lib/tiger/tiger_test.ml b/compiler/src/lib/tiger/tiger_test.ml index fe84ef8..038cd84 100644 --- a/compiler/src/lib/tiger/tiger_test.ml +++ b/compiler/src/lib/tiger/tiger_test.ml @@ -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 diff --git a/compiler/src/lib/tiger/tiger_test_cases.ml b/compiler/src/lib/tiger/tiger_test_cases.ml index 45a4e1d..8169083 100644 --- a/compiler/src/lib/tiger/tiger_test_cases.ml +++ b/compiler/src/lib/tiger/tiger_test_cases.ml @@ -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 =