mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-10-13 15:32:03 +00:00
Only support escape literals for Postgres, Redshift and generic dialect (#1674)
This commit is contained in:
parent
4f7154288e
commit
ef072be9e1
6 changed files with 69 additions and 2 deletions
|
@ -240,13 +240,17 @@ impl TestedDialects {
|
|||
|
||||
/// Check that the tokenizer returns the expected tokens for the given SQL.
|
||||
pub fn tokenizes_to(&self, sql: &str, expected: Vec<Token>) {
|
||||
if self.dialects.is_empty() {
|
||||
panic!("No dialects to test");
|
||||
}
|
||||
|
||||
self.dialects.iter().for_each(|dialect| {
|
||||
let mut tokenizer = Tokenizer::new(&**dialect, sql);
|
||||
if let Some(options) = &self.options {
|
||||
tokenizer = tokenizer.with_unescape(options.unescape);
|
||||
}
|
||||
let tokens = tokenizer.tokenize().unwrap();
|
||||
assert_eq!(expected, tokens);
|
||||
assert_eq!(expected, tokens, "Tokenized differently for {:?}", dialect);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue