From 32cc150b5fc06e0c547b6d464cc6fa547ba874ba Mon Sep 17 00:00:00 2001 From: Chimrod <> Date: Mon, 11 Dec 2023 16:42:56 +0100 Subject: Added a new error message in case of missing operand --- test/syntax_error.ml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test/syntax_error.ml') 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; ] ) -- cgit v1.2.3