Fix infinite loop on unterminated string in query

This commit is contained in:
Max Brunsfeld 2019-09-11 14:44:49 -07:00
parent a1fec71b19
commit 86205b9e6d
2 changed files with 9 additions and 3 deletions

View file

@ -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))
);
});
}