From acc7d589ee6b0740af79abea0e29ccf504984fd1 Mon Sep 17 00:00:00 2001 From: Chimrod <> Date: Sun, 31 Mar 2024 18:03:58 +0200 Subject: Dedicated error message for '+ =' --- test/syntax_error.ml | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/syntax_error.ml') diff --git a/test/syntax_error.ml b/test/syntax_error.ml index f65042a..5587908 100644 --- a/test/syntax_error.ml +++ b/test/syntax_error.ml @@ -248,6 +248,17 @@ let unclosed_act () = If there are nested blocks, the error will points the highest block."; } +let unknown_operator () = + _test_instruction + {| + variable + = 1 +|} + { + level = Error; + loc = _position; + message = "Unknown operator. Did you write '+ =' instead of '+=' ?"; + } + let test = ( "Syntax Errors", [ @@ -268,4 +279,5 @@ let test = Alcotest.test_case "Misplaced if" `Quick misplaced_if; Alcotest.test_case "(()" `Quick unclosed_paren2; Alcotest.test_case "act: else" `Quick unclosed_act; + Alcotest.test_case "+ =" `Quick unknown_operator; ] ) -- cgit v1.2.3