parent
3497f34dd7
commit
99cd283e39
2 changed files with 36 additions and 5 deletions
|
|
@ -1835,6 +1835,33 @@ fn test_query_matches_with_no_captures() {
|
|||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_query_matches_with_repeated_fields() {
|
||||
allocations::record(|| {
|
||||
let language = get_language("c");
|
||||
let query = Query::new(
|
||||
language,
|
||||
"(field_declaration declarator: (field_identifier) @field)",
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
assert_query_matches(
|
||||
language,
|
||||
&query,
|
||||
"
|
||||
struct S {
|
||||
int a, b, c;
|
||||
}
|
||||
",
|
||||
&[
|
||||
(0, vec![("field", "a")]),
|
||||
(0, vec![("field", "b")]),
|
||||
(0, vec![("field", "c")]),
|
||||
],
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_query_captures_basic() {
|
||||
allocations::record(|| {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue