Skip to content

Commit 0d34152

Browse files
committed
Use verified_statement in Snowflake TEXT tests
1 parent ab33d32 commit 0d34152

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/test_utils.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,15 @@ impl TestedDialects {
199199
/// Ensures that `sql` parses as a single [Statement], and that
200200
/// re-serializing the parse result produces the same `sql`
201201
/// string (is not modified after a serialization round-trip).
202-
pub fn verified_stmt(&self, sql: &str) -> Statement {
202+
pub fn verified_statement(&self, sql: &str) -> Statement {
203203
self.one_statement_parses_to(sql, sql)
204204
}
205205

206+
/// Shorthand for [`TestedDialects::verified_statement`].
207+
pub fn verified_stmt(&self, sql: &str) -> Statement {
208+
self.verified_statement(sql)
209+
}
210+
206211
/// Ensures that `sql` parses as a single [Query], and that
207212
/// re-serializing the parse result produces the same `sql`
208213
/// string (is not modified after a serialization round-trip).

tests/sqlparser_snowflake.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5032,15 +5032,12 @@ fn test_text_cast_with_length_modifier() {
50325032
_ => unreachable!(),
50335033
}
50345034

5035-
snowflake().one_statement_parses_to(
5036-
"SELECT col::TEXT(16777216) AS col FROM t",
5037-
"SELECT col::TEXT(16777216) AS col FROM t",
5038-
);
5035+
snowflake().verified_statement("SELECT col::TEXT(16777216) AS col FROM t");
50395036
}
50405037

50415038
#[test]
50425039
fn test_plain_text_data_type_still_parses_as_text() {
5043-
match snowflake().verified_stmt("CREATE TABLE t (c TEXT)") {
5040+
match snowflake().verified_statement("CREATE TABLE t (c TEXT)") {
50445041
Statement::CreateTable(CreateTable { columns, .. }) => {
50455042
assert_eq!(columns[0].data_type, DataType::Text);
50465043
}

0 commit comments

Comments
 (0)