chore: remove redundant punctuation (#1434)

This commit is contained in:
Fischer 2024-09-21 00:39:17 +08:00 committed by GitHub
parent 04a53e5753
commit 71318df8b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 16 additions and 16 deletions

View file

@ -1264,7 +1264,7 @@ impl<'a> Parser<'a> {
self.prev_token();
self.parse_duckdb_struct_literal()
}
_ => self.expected("an expression:", next_token),
_ => self.expected("an expression", next_token),
}?;
if self.parse_keyword(Keyword::COLLATE) {

View file

@ -276,13 +276,13 @@ fn parse_alter_table_attach_and_detach_partition() {
clickhouse_and_generic()
.parse_sql_statements(format!("ALTER TABLE t0 {operation} PARTITION").as_str())
.unwrap_err(),
ParserError("Expected: an expression:, found: EOF".to_string())
ParserError("Expected: an expression, found: EOF".to_string())
);
assert_eq!(
clickhouse_and_generic()
.parse_sql_statements(format!("ALTER TABLE t0 {operation} PART").as_str())
.unwrap_err(),
ParserError("Expected: an expression:, found: EOF".to_string())
ParserError("Expected: an expression, found: EOF".to_string())
);
}
}
@ -355,7 +355,7 @@ fn parse_alter_table_add_projection() {
clickhouse_and_generic()
.parse_sql_statements("ALTER TABLE t0 ADD PROJECTION my_name (SELECT)")
.unwrap_err(),
ParserError("Expected: an expression:, found: )".to_string())
ParserError("Expected: an expression, found: )".to_string())
);
}
@ -498,13 +498,13 @@ fn parse_optimize_table() {
clickhouse_and_generic()
.parse_sql_statements("OPTIMIZE TABLE t0 DEDUPLICATE BY")
.unwrap_err(),
ParserError("Expected: an expression:, found: EOF".to_string())
ParserError("Expected: an expression, found: EOF".to_string())
);
assert_eq!(
clickhouse_and_generic()
.parse_sql_statements("OPTIMIZE TABLE t0 PARTITION")
.unwrap_err(),
ParserError("Expected: an expression:, found: EOF".to_string())
ParserError("Expected: an expression, found: EOF".to_string())
);
assert_eq!(
clickhouse_and_generic()
@ -1479,7 +1479,7 @@ fn parse_freeze_and_unfreeze_partition() {
clickhouse_and_generic()
.parse_sql_statements(format!("ALTER TABLE t0 {operation_name} PARTITION").as_str())
.unwrap_err(),
ParserError("Expected: an expression:, found: EOF".to_string())
ParserError("Expected: an expression, found: EOF".to_string())
);
assert_eq!(
clickhouse_and_generic()

View file

@ -2051,7 +2051,7 @@ fn parse_tuple_invalid() {
let sql = "select (), 2";
let res = parse_sql_statements(sql);
assert_eq!(
ParserError::ParserError("Expected: an expression:, found: )".to_string()),
ParserError::ParserError("Expected: an expression, found: )".to_string()),
res.unwrap_err()
);
}
@ -9556,7 +9556,7 @@ fn parse_projection_trailing_comma() {
trailing_commas
.parse_sql_statements("SELECT * FROM track ORDER BY milliseconds,")
.unwrap_err(),
ParserError::ParserError("Expected: an expression:, found: EOF".to_string())
ParserError::ParserError("Expected: an expression, found: EOF".to_string())
);
assert_eq!(

View file

@ -64,7 +64,7 @@ fn test_databricks_exists() {
let res = databricks().parse_sql_statements("SELECT EXISTS (");
assert_eq!(
// TODO: improve this error message...
ParserError::ParserError("Expected: an expression:, found: EOF".to_string()),
ParserError::ParserError("Expected: an expression, found: EOF".to_string()),
res.unwrap_err(),
);
}

View file

@ -487,7 +487,7 @@ fn parse_convert() {
let error_sql = "SELECT CONVERT(INT, 'foo',) FROM T";
assert_eq!(
ParserError::ParserError("Expected: an expression:, found: )".to_owned()),
ParserError::ParserError("Expected: an expression, found: )".to_owned()),
ms().parse_sql_statements(error_sql).unwrap_err()
);
}

View file

@ -1230,13 +1230,13 @@ fn parse_snowflake_declare_result_set() {
let error_sql = "DECLARE res RESULTSET DEFAULT";
assert_eq!(
ParserError::ParserError("Expected: an expression:, found: EOF".to_owned()),
ParserError::ParserError("Expected: an expression, found: EOF".to_owned()),
snowflake().parse_sql_statements(error_sql).unwrap_err()
);
let error_sql = "DECLARE res RESULTSET :=";
assert_eq!(
ParserError::ParserError("Expected: an expression:, found: EOF".to_owned()),
ParserError::ParserError("Expected: an expression, found: EOF".to_owned()),
snowflake().parse_sql_statements(error_sql).unwrap_err()
);
}
@ -1328,13 +1328,13 @@ fn parse_snowflake_declare_variable() {
let error_sql = "DECLARE profit INT DEFAULT";
assert_eq!(
ParserError::ParserError("Expected: an expression:, found: EOF".to_owned()),
ParserError::ParserError("Expected: an expression, found: EOF".to_owned()),
snowflake().parse_sql_statements(error_sql).unwrap_err()
);
let error_sql = "DECLARE profit DEFAULT";
assert_eq!(
ParserError::ParserError("Expected: an expression:, found: EOF".to_owned()),
ParserError::ParserError("Expected: an expression, found: EOF".to_owned()),
snowflake().parse_sql_statements(error_sql).unwrap_err()
);
}

View file

@ -432,7 +432,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()
);
}