Allow queries with no patterns

This commit is contained in:
Max Brunsfeld 2019-09-26 15:58:41 -07:00
parent c153711539
commit 4c17af3ecd
2 changed files with 11 additions and 3 deletions

View file

@ -1029,6 +1029,16 @@ fn test_query_capture_names() {
});
}
#[test]
fn test_query_with_no_patterns() {
allocations::record(|| {
let language = get_language("javascript");
let query = Query::new(language, "").unwrap();
assert!(query.capture_names().is_empty());
assert_eq!(query.pattern_count(), 0);
});
}
#[test]
fn test_query_comments() {
allocations::record(|| {