diff options
author | Chimrod <> | 2024-04-08 10:27:14 +0200 |
---|---|---|
committer | Chimrod <> | 2024-04-08 10:27:14 +0200 |
commit | b7cc3a4f423ed6ed98cbf87a408fe80335e4ab9b (patch) | |
tree | 1e933bc673423bc93899be3c70da10b35961b042 /test | |
parent | acc7d589ee6b0740af79abea0e29ccf504984fd1 (diff) |
Handle syntax error in string escape mecamism
Diffstat (limited to 'test')
-rw-r--r-- | test/syntax_error.ml | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/test/syntax_error.ml b/test/syntax_error.ml index 5587908..2187e89 100644 --- a/test/syntax_error.ml +++ b/test/syntax_error.ml @@ -92,7 +92,7 @@ let missing_ampersand () = let unclose_comment () = _test_instruction {| ! that's it|} - { level = Error; loc = _position; message = "Unclosed text" } + { level = Error; loc = _position; message = "Unclosed string" } let syntax_error () = _test_instruction {|*clr $ cla|} @@ -259,6 +259,13 @@ let unknown_operator () = message = "Unknown operator. Did you write '+ =' instead of '+=' ?"; } +let nested_string_mess () = + _test_instruction + {| + '<<func('…', '…')>>' +|} + { level = Error; loc = _position; message = "Unclosed string" } + let test = ( "Syntax Errors", [ @@ -280,4 +287,5 @@ let test = Alcotest.test_case "(()" `Quick unclosed_paren2; Alcotest.test_case "act: else" `Quick unclosed_act; Alcotest.test_case "+ =" `Quick unknown_operator; + Alcotest.test_case "'<<''>>'" `Quick nested_string_mess; ] ) |