From 40f4dbe7844725e0ab07f03f25c35f55b4699b46 Mon Sep 17 00:00:00 2001 From: Chimrod <> Date: Thu, 5 Oct 2023 21:29:52 +0200 Subject: Two new error messages --- test/syntax_error.ml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'test/syntax_error.ml') diff --git a/test/syntax_error.ml b/test/syntax_error.ml index 2ca615f..ee39001 100644 --- a/test/syntax_error.ml +++ b/test/syntax_error.ml @@ -75,7 +75,7 @@ let act_no_column () = message = "Invalid `ACT` label. You probably missed a ':'"; } -let missing_ampersand () = +let missing_ampersand_1 () = _test_instruction "b = 1 a = 2" { level = Error; @@ -83,6 +83,22 @@ let missing_ampersand () = message = "Missing separator between instructions"; } +let missing_ampersand_2 () = + _test_instruction "let b = 1 a = 2" + { + level = Error; + loc = _position; + message = "Missing separator between instructions"; + } + +let missing_ampersand_3 () = + _test_instruction "set b = 1 a = 2" + { + level = Error; + loc = _position; + message = "Missing separator between instructions"; + } + let test = ( "Syntax Errors", [ @@ -90,5 +106,7 @@ let test = Alcotest.test_case "elseif" `Quick elseif_no_column; Alcotest.test_case "(1" `Quick unclosed_paren; Alcotest.test_case "act 1" `Quick act_no_column; - Alcotest.test_case "no &" `Quick missing_ampersand; + Alcotest.test_case "no &" `Quick missing_ampersand_1; + Alcotest.test_case "no &" `Quick missing_ampersand_2; + Alcotest.test_case "no &" `Quick missing_ampersand_3; ] ) -- cgit v1.2.3