Merge remote-tracking branch 'origin/master' into ensure-extras-is-array
This commit is contained in:
commit
adce3cb8e2
7 changed files with 64 additions and 9 deletions
|
|
@ -1691,6 +1691,36 @@ fn test_query_matches_with_multiple_captures_on_a_node() {
|
|||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_query_matches_with_no_captures() {
|
||||
allocations::record(|| {
|
||||
let language = get_language("javascript");
|
||||
let query = Query::new(
|
||||
language,
|
||||
r#"
|
||||
(identifier)
|
||||
(string) @s
|
||||
"#,
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
assert_query_matches(
|
||||
language,
|
||||
&query,
|
||||
"
|
||||
a = 'hi';
|
||||
b = 'bye';
|
||||
",
|
||||
&[
|
||||
(0, vec![]),
|
||||
(1, vec![("s", "'hi'")]),
|
||||
(0, vec![]),
|
||||
(1, vec![("s", "'bye'")]),
|
||||
],
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_query_captures_basic() {
|
||||
allocations::record(|| {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue