From cb00a20dd1203e44609285b3e14e0e28cef2c06c Mon Sep 17 00:00:00 2001 From: Siraaj Khandkar Date: Wed, 23 May 2018 21:46:33 -0400 Subject: [PATCH] Add another test case --- tiger/src/exe/tiger_tests.ml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tiger/src/exe/tiger_tests.ml b/tiger/src/exe/tiger_tests.ml index b76f368..3b1a0c2 100644 --- a/tiger/src/exe/tiger_tests.ml +++ b/tiger/src/exe/tiger_tests.ml @@ -129,6 +129,23 @@ let test_04 = in (name, code, tokens) +let test_09 = + let name = "error : types of then - else differ" in + let code = + " + /* "^name^" */ + + if (5>4) then 13 else \" \" + " + in + let tokens = + let open Tiger.Parser.Token in + [ IF; LPAREN; INT 5; GT; INT 4; RPAREN; THEN; INT 13; ELSE; STRING " " + ] + in + (* TODO: Type error test case *) + (name, code, tokens) + let tokens_of_code code = let lexbuf = Lexing.from_string code in let rec tokens () = @@ -143,6 +160,7 @@ let tests = ; test_02 ; test_03 ; test_04 + ; test_09 ] let () = -- 2.20.1