Skip to content

Commit

Permalink
refactor: skip -> skip_parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikaverpil committed Jul 3, 2024
1 parent 06d2365 commit 70a02b3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
8 changes: 3 additions & 5 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.skip_parsing == true then
---@type table<string, neotest.Result>
local results = {}
results[spec.context.id] = {
Expand Down Expand Up @@ -69,9 +69,7 @@ function M.results(spec, result, tree)
--- Test command (e.g. 'go test') status.
--- @type neotest.ResultStatus
local test_command_status = "skipped"
if spec.context.skip == true then
test_command_status = "skipped"
elseif result.code == 0 then
if result.code == 0 then
test_command_status = "passed"
else
test_command_status = "failed"
Expand All @@ -95,7 +93,7 @@ function M.results(spec, result, tree)
}

-- if the test execution was skipped, return early
if spec.context.skip == true then
if spec.context.skip_parsing == 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,
skip_parsing = 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,
skip_parsing = 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 @@ -55,7 +55,7 @@ function M.build(pos, strategy)

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

return run_spec
Expand Down

0 comments on commit 70a02b3

Please sign in to comment.