diff options
| author | Chimrod <> | 2023-12-11 16:42:56 +0100 | 
|---|---|---|
| committer | Chimrod <> | 2023-12-11 16:59:52 +0100 | 
| commit | 32cc150b5fc06e0c547b6d464cc6fa547ba874ba (patch) | |
| tree | 9a2ef6e11351449a521f1a66d3b5d3246e879cd5 /test/syntax_error.ml | |
| parent | 6dc8d7789aa165663d135c62a9f766b6b26c4920 (diff) | |
Added a new error message in case of missing operand
Diffstat (limited to 'test/syntax_error.ml')
| -rw-r--r-- | test/syntax_error.ml | 18 | 
1 files changed, 18 insertions, 0 deletions
| diff --git a/test/syntax_error.ml b/test/syntax_error.ml index d814cbe..e8d29a2 100644 --- a/test/syntax_error.ml +++ b/test/syntax_error.ml @@ -169,6 +169,23 @@ let comment_as_operator () =    _test_instruction "gs 'a', 'b' ! target" result;    _test_instruction "gs 'a' ! target" result +let missing_comparable () = +  let result = +    { +      level = Error; +      loc = _position; +      message = "Missing boolean after operator"; +    } +  in +  _test_instruction "1 and >= 0" result; +  _test_instruction "1 >= and 0" result; +  _test_instruction "1 > and 0" result; +  _test_instruction "1 < and 0" result; +  _test_instruction "1 or >= 0" result; +  _test_instruction "1 >= or 0" result; +  _test_instruction "1 <= or 0" result; +  _test_instruction "1 = or 0" result +  let test =    ( "Syntax Errors",      [ @@ -184,4 +201,5 @@ let test =        Alcotest.test_case "Inline elif" `Quick inline_elif;        Alcotest.test_case "Unclosed block" `Quick unclosed_block;        Alcotest.test_case "Unclosed block" `Quick comment_as_operator; +      Alcotest.test_case "Missing comparable" `Quick missing_comparable;      ] ) | 
