From 91db21964ce2d583719c353eb53ad46e8333442a Mon Sep 17 00:00:00 2001 From: Ken Sheedlo Date: Sat, 2 May 2015 12:54:34 -0700 Subject: [PATCH] add test case for nested typed expression This change adds a test case for #62. Stepping through in the debugger suggests that both selectors are run against the same AST. Since the `_str$s` variable matches an AST nested inside the `$e` expression and the `$e` expression appears first, the intended `_str$s` is not found. --- test/replace.ls | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/replace.ls b/test/replace.ls index 5f9fb13..29b27b8 100644 --- a/test/replace.ls +++ b/test/replace.ls @@ -188,6 +188,9 @@ suite 'replace' -> test 'equery with {} in replacement' -> eq '--equery --replace "f({{__ && {} }})" "__ && __"', 'var a = f(b && {});', it, {input: 'var a = b && {};'} + test 'equery with nested typed expression (GH #62)' -> + eq '--equery --replace "{{e}}.qux({{_str$s}})" "$e.baz(_str$s)"', 'foo(\'bar\').qux(\'zap\')', it, {input: 'foo(\'bar\').baz(\'zap\')'} + suite 'filters' -> obj-input = ''' var obj = {