Skip to content

Commit

Permalink
fix: differentiate between "skip" and "debug_skip"
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikaverpil committed Jul 3, 2024
1 parent db8982f commit e09dcb6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion lua/neotest-golang/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ function M.workaround_neotest_issue_391(result)
-- FIXME: once output is parsed, erase file contents, so to avoid JSON in
-- output panel. This is a workaround for now, only because of
-- https://github.com/nvim-neotest/neotest/issues/391
vim.fn.writefile({ "" }, result.output)
if result.output ~= nil then
vim.fn.writefile({ "" }, result.output)
end
end

--- Adapter options.
Expand Down
4 changes: 2 additions & 2 deletions lua/neotest-golang/parse.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ local M = {}
--- @param tree neotest.Tree
--- @return table<string, neotest.Result>
function M.results(spec, result, tree)
if spec.context.skip == true then
if spec.context.debug_and_skip == true then
---@type table<string, neotest.Result>
local results = {}
results[spec.context.id] = {
Expand Down Expand Up @@ -95,7 +95,7 @@ function M.results(spec, result, tree)
}

-- if the test execution was skipped, return early
if spec.context.skip == true then
if spec.context.test_execution_skipped == true then
return neotest_result
end

Expand Down
2 changes: 1 addition & 1 deletion lua/neotest-golang/runspec_dir.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function M.build(pos)
command = { "echo", msg },
context = {
id = pos.id,
skip = true,
test_execution_skipped = true,
pos_type = "dir",
},
}
Expand Down
2 changes: 1 addition & 1 deletion lua/neotest-golang/runspec_file.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function M.build(pos, tree)
command = { "echo", "No tests found in file" },
context = {
id = pos.id,
skip = true,
test_execution_skipped = true,
pos_type = "test", -- TODO: to be implemented as "file" later
},
}
Expand Down
2 changes: 1 addition & 1 deletion lua/neotest-golang/runspec_test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function M.build(pos, strategy)

if runspec_strategy ~= nil then
run_spec.strategy = runspec_strategy
run_spec.context.skip = true
run_spec.context.debug_and_skip = true
end

return run_spec
Expand Down

0 comments on commit e09dcb6

Please sign in to comment.