From 069bcebfdeb770d773e9de7f9bdadc62f86b8339 Mon Sep 17 00:00:00 2001 From: Alexander Ulmer Date: Mon, 9 Aug 2021 15:30:11 +0200 Subject: [PATCH] add tests --- .../parse_error_statements_tests.rs | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/parser/tests/parse_errors/parse_error_statements_tests.rs b/src/parser/tests/parse_errors/parse_error_statements_tests.rs index 6697802c1a..a033f0ee22 100644 --- a/src/parser/tests/parse_errors/parse_error_statements_tests.rs +++ b/src/parser/tests/parse_errors/parse_error_statements_tests.rs @@ -313,6 +313,8 @@ fn invalid_variable_data_type_error_recovery() { VAR a DINT : ; c : INT; + h , , : INT; + f , INT : ; END_VAR END_PROGRAM "); @@ -345,7 +347,23 @@ fn invalid_variable_data_type_error_recovery() { "DataTypeDefinition".into(), "KeywordSemicolon".into(), SourceRange::new(61..62) - ) + ), + Diagnostic::missing_token("KeywordColon".into(), SourceRange::new(108..109)), + Diagnostic::unexpected_token_found( + "DataTypeDefinition".into(), + "KeywordComma".into(), + SourceRange::new(108..109) + ), + Diagnostic::unexpected_token_found( + "KeywordSemicolon".into(), + "', : INT'".into(), + SourceRange::new(108..115) + ), + Diagnostic::unexpected_token_found( + "DataTypeDefinition".into(), + "KeywordSemicolon".into(), + SourceRange::new(143..144) + ), ] ); }