From 736456d9952c1d58008f4ca5755913dfff7a32b8 Mon Sep 17 00:00:00 2001 From: Chimrod <> Date: Tue, 17 Oct 2023 19:49:48 +0200 Subject: New message for error --- test/syntax_error.ml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/syntax_error.ml b/test/syntax_error.ml index d395dba..6c28f0f 100644 --- a/test/syntax_error.ml +++ b/test/syntax_error.ml @@ -1,4 +1,3 @@ -module Parser = Qparser.Parser.Make (Qsp_syntax.Tree) module Ast = Qsp_syntax.Tree.Ast module S = Qsp_syntax.S @@ -109,6 +108,17 @@ let unknow_function () = _test_instruction "a = ran(1, 2)" { level = Error; loc = _position; message = "Unexpected expression here." } +let inline_elif () = + _test_instruction {| + if a = 1: + elseif a = 1: a = 1 + end|} + { + level = Error; + loc = _position; + message = "Mix between IF block and inline ELIF"; + } + let test = ( "Syntax Errors", [ @@ -121,4 +131,5 @@ let test = Alcotest.test_case "Syntax error $" `Quick syntax_error; Alcotest.test_case "Missing operand" `Quick missing_operand; Alcotest.test_case "Unknown function" `Quick unknow_function; + Alcotest.test_case "Inline elif" `Quick inline_elif; ] ) -- cgit v1.2.3