diff --git a/lua/neotest-busted/init.lua b/lua/neotest-busted/init.lua index bedb228..37302d1 100644 --- a/lua/neotest-busted/init.lua +++ b/lua/neotest-busted/init.lua @@ -129,8 +129,7 @@ end ---@return string local function escape_test_pattern_filter(filter) -- NOTE: The replacement of a literal '%' needs to come first so it does - -- match any earlier replacements that insert a '%'. Also we need to escape - -- '$' for the shell command to work + -- match any earlier replacements that insert a '%'. return ( filter :gsub("%%", "%%%%") @@ -141,7 +140,7 @@ local function escape_test_pattern_filter(filter) :gsub("%+", "%%+") :gsub("%-", "%%-") :gsub("%?", "%%?") - :gsub("%$", "%%\\$") + :gsub("%$", "%%$") :gsub("%^", "%%^") ) end diff --git a/tests/adapter_build_spec_spec.lua b/tests/adapter_build_spec_spec.lua index 29c6157..8643f53 100644 --- a/tests/adapter_build_spec_spec.lua +++ b/tests/adapter_build_spec_spec.lua @@ -235,7 +235,7 @@ describe("adapter.build_spec", function() "test-output.json", "--verbose", "--filter", - [[%^top%-le%[ve]l %(na%*m%+e%-sp%?ac%%e%) 2%\$ test 3]], + [[%^top%-le%[ve]l %(na%*m%+e%-sp%?ac%%e%) 2%$ test 3]], "./test_files/test1_spec.lua", })