query: Handle #not-match? in rust, wasm bindings
This commit is contained in:
parent
32099050d6
commit
1ae5cbc851
4 changed files with 25 additions and 7 deletions
|
|
@ -1470,12 +1470,17 @@ fn test_query_captures_with_text_conditions() {
|
|||
((identifier) @function.builtin
|
||||
(#eq? @function.builtin "require"))
|
||||
|
||||
(identifier) @variable
|
||||
((identifier) @variable
|
||||
(#not-match? @variable "^(lambda|load)$"))
|
||||
"#,
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
let source = "
|
||||
toad
|
||||
load
|
||||
panda
|
||||
lambda
|
||||
const ab = require('./ab');
|
||||
new Cd(EF);
|
||||
";
|
||||
|
|
@ -1489,6 +1494,8 @@ fn test_query_captures_with_text_conditions() {
|
|||
assert_eq!(
|
||||
collect_captures(captures, &query, source),
|
||||
&[
|
||||
("variable", "toad"),
|
||||
("variable", "panda"),
|
||||
("variable", "ab"),
|
||||
("function.builtin", "require"),
|
||||
("variable", "require"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue