mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-23 17:05:36 +01:00
Add unit test for checking SELECT FROM foo;
returns only one error and stops parsing.
This commit is contained in:
@@ -338,6 +338,21 @@ fn qualified_table_name_within_triggers() {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn select_from_error_stops_at_first_error() {
|
||||
let mut parser = Parser::new(b"SELECT FROM foo;");
|
||||
|
||||
// First next() call should return the first syntax error
|
||||
let err = parser.next().unwrap_err();
|
||||
assert!(matches!(err, Error::ParserError(_, _, _)));
|
||||
|
||||
// Second next() call should return Ok(None) since parsing should have stopped
|
||||
assert_eq!(parser.next().unwrap(), None);
|
||||
|
||||
// Third next() call should also return Ok(None)
|
||||
assert_eq!(parser.next().unwrap(), None);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn indexed_by_clause_within_triggers() {
|
||||
expect_parser_err_msg(
|
||||
|
||||
Reference in New Issue
Block a user