mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-10-17 01:07:19 +00:00
Make clippy happy (#330)
Signed-off-by: koushiro <koushiro.cqx@gmail.com>
This commit is contained in:
parent
e5991f3ae5
commit
67e17b27f5
14 changed files with 56 additions and 43 deletions
|
@ -18,10 +18,10 @@
|
|||
// via `tests/test_utils/mod.rs`.
|
||||
use std::fmt::Debug;
|
||||
|
||||
use super::ast::*;
|
||||
use super::dialect::*;
|
||||
use super::parser::{Parser, ParserError};
|
||||
use super::tokenizer::Tokenizer;
|
||||
use crate::ast::*;
|
||||
use crate::dialect::*;
|
||||
use crate::parser::{Parser, ParserError};
|
||||
use crate::tokenizer::Tokenizer;
|
||||
|
||||
/// Tests use the methods on this struct to invoke the parser on one or
|
||||
/// multiple dialects.
|
||||
|
@ -64,7 +64,7 @@ impl TestedDialects {
|
|||
}
|
||||
|
||||
pub fn parse_sql_statements(&self, sql: &str) -> Result<Vec<Statement>, ParserError> {
|
||||
self.one_of_identical_results(|dialect| Parser::parse_sql(dialect, &sql))
|
||||
self.one_of_identical_results(|dialect| Parser::parse_sql(dialect, sql))
|
||||
// To fail the `ensure_multiple_dialects_are_tested` test:
|
||||
// Parser::parse_sql(&**self.dialects.first().unwrap(), sql)
|
||||
}
|
||||
|
@ -75,11 +75,11 @@ impl TestedDialects {
|
|||
/// tree as parsing `canonical`, and that serializing it back to string
|
||||
/// results in the `canonical` representation.
|
||||
pub fn one_statement_parses_to(&self, sql: &str, canonical: &str) -> Statement {
|
||||
let mut statements = self.parse_sql_statements(&sql).unwrap();
|
||||
let mut statements = self.parse_sql_statements(sql).unwrap();
|
||||
assert_eq!(statements.len(), 1);
|
||||
|
||||
if !canonical.is_empty() && sql != canonical {
|
||||
assert_eq!(self.parse_sql_statements(&canonical).unwrap(), statements);
|
||||
assert_eq!(self.parse_sql_statements(canonical).unwrap(), statements);
|
||||
}
|
||||
|
||||
let only_statement = statements.pop().unwrap();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue