refactor(parsing): remove old FromStr-based parser implementation

This commit is contained in:
Khaïs COLIN 2025-05-04 18:17:36 +02:00
parent 106c2547b5
commit 6b49d3ca14
9 changed files with 67 additions and 99 deletions

View file

@ -307,32 +307,9 @@ mod tests {
#[test]
fn test_tokenizer_errors() {
let mut scanerrors = tokenize("salact +".to_string(), "src/statement.sql".to_string())
let scanerrors = tokenize("salact +".to_string(), "src/statement.sql".to_string())
.err()
.unwrap();
scanerrors.reverse();
assert_eq!(
scanerrors.pop(),
Some(ScanError {
location: Location {
file: "src/statement.sql".to_string(),
offset: 0,
length: 6,
},
kind: ScanErrorKind::UnknownKeyword("salact".to_string()),
})
);
assert_eq!(
scanerrors.pop(),
Some(ScanError {
location: Location {
file: "src/statement.sql".to_string(),
offset: 8,
length: 1,
},
kind: ScanErrorKind::UnexpectedChar('+'),
})
);
assert!(scanerrors.is_empty());
assert_debug_snapshot!(scanerrors);
}
}