Fix infinite loop on unterminated string in query
This commit is contained in:
parent
a1fec71b19
commit
86205b9e6d
2 changed files with 9 additions and 3 deletions
|
|
@ -31,9 +31,10 @@ fn test_query_errors_on_invalid_syntax() {
|
|||
Err(QueryError::Syntax(24))
|
||||
);
|
||||
|
||||
// Return an error at the beginning of an unterminated string.
|
||||
assert_eq!(
|
||||
Query::new(language, "(if_statement condition:)"),
|
||||
Err(QueryError::Syntax(24))
|
||||
Query::new(language, r#"(identifier) "h "#),
|
||||
Err(QueryError::Syntax(13))
|
||||
);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue