Use a more realistic example in one JS query unit test

This commit is contained in:
Max Brunsfeld 2019-09-16 12:48:01 -07:00
parent 9323ba52c8
commit b79839b599

View file

@ -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))
`);