Use a more realistic example in one JS query unit test
This commit is contained in:
parent
9323ba52c8
commit
b79839b599
1 changed files with 6 additions and 6 deletions
|
|
@ -175,15 +175,15 @@ describe("Query", () => {
|
|||
|
||||
it('handles conditions that compare the text of capture to each other', () => {
|
||||
tree = parser.parse(`
|
||||
const ab = abc + 1;
|
||||
const def = de + 1;
|
||||
const ghi = ghi + 1;
|
||||
ab = abc + 1;
|
||||
def = de + 1;
|
||||
ghi = ghi + 1;
|
||||
`);
|
||||
|
||||
query = JavaScript.query(`
|
||||
((variable_declarator
|
||||
name: (identifier) @id1
|
||||
value: (binary_expression
|
||||
((assignment_expression
|
||||
left: (identifier) @id1
|
||||
right: (binary_expression
|
||||
left: (identifier) @id2))
|
||||
(eq? @id1 @id2))
|
||||
`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue