diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/syntax_error.ml | 13 |
1 files changed, 12 insertions, 1 deletions
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; ] ) |