diff --git a/lua/neotest-golang/logging.lua b/lua/neotest-golang/logging.lua index 13802e1d..3cd8fdc6 100644 --- a/lua/neotest-golang/logging.lua +++ b/lua/neotest-golang/logging.lua @@ -7,10 +7,9 @@ local prefix = "[neotest-golang] " local function clean_output(str) -- Replace escaped newlines and tabs with spaces - -- FIXME: commented out temporarily - -- str = str:gsub("[\n\t]", " ") + str = str:gsub("[\n\t]", " ") -- Collapse multiple spaces into one - -- str = str:gsub("%s+", " ") + str = str:gsub("%s+", " ") return str end diff --git a/lua/neotest-golang/process.lua b/lua/neotest-golang/process.lua index 98869339..791c566e 100644 --- a/lua/neotest-golang/process.lua +++ b/lua/neotest-golang/process.lua @@ -80,9 +80,7 @@ function M.test_results(spec, result, tree) raw_output = async.fn.readfile(context.test_output_json_filepath) end - logger.debug({ "Raw output from readfile", raw_output }) local gotest_output = lib.json.decode_from_table(raw_output) - logger.debug({ "Table JSON-decoded", gotest_output }) --- The 'go list -json' output, converted into a lua table. local golist_output = context.golist_data @@ -133,7 +131,8 @@ function M.test_results(spec, result, tree) end -- DEBUG: enable the following to see the final Neotest result. - logger.debug(vim.inspect(res)) + -- logger.debug(vim.inspect(res)) + -- logger.debug(vim.inspect(neotest_result)) return neotest_result end @@ -218,7 +217,6 @@ function M.decorate_with_go_package_and_test_name( local folderpath = vim.fn.fnamemodify(test_data.neotest_data.path, ":h") local tweaked_pos_id = pos_id:gsub(" ", "_") tweaked_pos_id = tweaked_pos_id:gsub('"', "") - -- tweaked_pos_id = tweaked_pos_id:gsub("\\", "/") -- FIXME: just testing this for windows tweaked_pos_id = tweaked_pos_id:gsub("::", "/") for _, golistline in ipairs(golist_output) do @@ -234,16 +232,9 @@ function M.decorate_with_go_package_and_test_name( .. "$" match = tweaked_pos_id:find(pattern, 1, false) - logger.debug({ - "Match position with log", - tweaked_pos_id, - pattern, - }) - if match ~= nil then test_data.gotest_data.pkg = gotestline.Package test_data.gotest_data.name = gotestline.Test - logger.debug("MATCH") break end end diff --git a/lua/neotest-golang/runspec/dir.lua b/lua/neotest-golang/runspec/dir.lua index 6d022f48..237d0ac6 100644 --- a/lua/neotest-golang/runspec/dir.lua +++ b/lua/neotest-golang/runspec/dir.lua @@ -23,8 +23,6 @@ function M.build(pos) return nil -- NOTE: logger.error will throw an error, but the LSP doesn't see it. end - logger.debug({ "Go mod filepath", go_mod_filepath }) - local go_mod_folderpath = vim.fn.fnamemodify(go_mod_filepath, ":h") local golist_data = lib.cmd.golist_data(go_mod_folderpath) @@ -59,6 +57,7 @@ function M.build(pos) context = context, } + logger.debug({ "RunSpec:", run_spec }) return run_spec end diff --git a/lua/neotest-golang/runspec/file.lua b/lua/neotest-golang/runspec/file.lua index f658cdc5..531304ec 100644 --- a/lua/neotest-golang/runspec/file.lua +++ b/lua/neotest-golang/runspec/file.lua @@ -22,8 +22,6 @@ function M.build(pos, tree) return nil -- NOTE: logger.error will throw an error, but the LSP doesn't see it. end - logger.debug({ "Go mod filepath", go_mod_filepath }) - local go_mod_folderpath = vim.fn.fnamemodify(go_mod_filepath, ":h") local golist_data = lib.cmd.golist_data(go_mod_folderpath) @@ -73,6 +71,7 @@ function M.build(pos, tree) context = context, } + logger.debug({ "RunSpec:", run_spec }) return run_spec end diff --git a/lua/neotest-golang/runspec/namespace.lua b/lua/neotest-golang/runspec/namespace.lua index 80b9c521..4165ea46 100644 --- a/lua/neotest-golang/runspec/namespace.lua +++ b/lua/neotest-golang/runspec/namespace.lua @@ -38,6 +38,7 @@ function M.build(pos) context = context, } + logger.debug({ "RunSpec:", run_spec }) return run_spec end