Improve error messages with additional colons (#1319)

This commit is contained in:
Lorrens Pantelis 2024-06-22 00:26:23 +02:00 committed by GitHub
parent 79af31b672
commit f16c1afed0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 144 additions and 144 deletions

View file

@ -428,7 +428,7 @@ fn invalid_empty_list() {
let sql = "SELECT * FROM t1 WHERE a IN (,,)";
let sqlite = sqlite_with_options(ParserOptions::new().with_trailing_commas(true));
assert_eq!(
"sql parser error: Expected an expression:, found: ,",
"sql parser error: Expected: an expression:, found: ,",
sqlite.parse_sql_statements(sql).unwrap_err().to_string()
);
}
@ -452,17 +452,17 @@ fn parse_start_transaction_with_modifier() {
};
let res = unsupported_dialects.parse_sql_statements("BEGIN DEFERRED");
assert_eq!(
ParserError::ParserError("Expected end of statement, found: DEFERRED".to_string()),
ParserError::ParserError("Expected: end of statement, found: DEFERRED".to_string()),
res.unwrap_err(),
);
let res = unsupported_dialects.parse_sql_statements("BEGIN IMMEDIATE");
assert_eq!(
ParserError::ParserError("Expected end of statement, found: IMMEDIATE".to_string()),
ParserError::ParserError("Expected: end of statement, found: IMMEDIATE".to_string()),
res.unwrap_err(),
);
let res = unsupported_dialects.parse_sql_statements("BEGIN EXCLUSIVE");
assert_eq!(
ParserError::ParserError("Expected end of statement, found: EXCLUSIVE".to_string()),
ParserError::ParserError("Expected: end of statement, found: EXCLUSIVE".to_string()),
res.unwrap_err(),
);
}