From d5517328dcf93c5bd74f1895262e47b70d2e4313 Mon Sep 17 00:00:00 2001 From: Siraaj Khandkar Date: Sun, 16 Sep 2018 14:10:01 -0400 Subject: [PATCH] Add micro test for recursive type def --- compiler/src/lib/tiger/tiger_test.ml | 2 +- compiler/src/lib/tiger/tiger_test_cases.ml | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) 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 = -- 2.20.1