diff --git a/lua/neotest-go/init.lua b/lua/neotest-go/init.lua index ab0b5e3..ea0ea52 100644 --- a/lua/neotest-go/init.lua +++ b/lua/neotest-go/init.lua @@ -164,7 +164,7 @@ function adapter.build_spec(args) local run_flag = {} if position.type == "test" then - run_flag = { "-run", "^" .. utils.get_prefix(args.tree) .. "$" } + run_flag = { "-run", "^" .. utils.get_test_id(args.tree) .. "$" } end local command = vim.tbl_flatten({ diff --git a/lua/neotest-go/utils.lua b/lua/neotest-go/utils.lua index 546844b..c10874a 100644 --- a/lua/neotest-go/utils.lua +++ b/lua/neotest-go/utils.lua @@ -158,7 +158,7 @@ end ---@param tree neotest.Tree ---@return string -function utils.get_prefix(tree) +function utils.get_test_id(tree) local parts = {} -- build test name for potentially deeply nested tests