diff options
Diffstat (limited to 'test/syntax_error.ml')
-rw-r--r-- | test/syntax_error.ml | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/syntax_error.ml b/test/syntax_error.ml index 04b91ad..490ec96 100644 --- a/test/syntax_error.ml +++ b/test/syntax_error.ml @@ -206,6 +206,26 @@ let location_change () = check' ~msg:"The location name is not valid" string ~actual ~expected:"Location")) +let misplaced_if () = + _test_instruction {| +if $ARGS[0] = 'arg': + 0 +end if|} + { + level = Error; + loc = _position; + message = "Unexpected instruction after `IF` `END` block."; + }; + _test_instruction {| +act 'arg': + 0 +end if|} + { + level = Error; + loc = _position; + message = "Unexpected instruction after `ACT` `END` block."; + } + (* The location name *) let test = @@ -225,4 +245,5 @@ let test = Alcotest.test_case "Unclosed block" `Quick comment_as_operator; Alcotest.test_case "Missing comparable" `Quick missing_comparable; Alcotest.test_case "Location change" `Quick location_change; + Alcotest.test_case "Misplaced if" `Quick misplaced_if; ] ) |