Skip to content

Commit

Permalink
chore: show one accumulated error instead of individual ones
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikaverpil committed Jun 24, 2024
1 parent 0e2ae49 commit 64ee645
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lua/neotest-golang/results_dir.lua
Original file line number Diff line number Diff line change
Expand Up @@ -285,19 +285,21 @@ function M.show_warnings(d)
)
end

-- warn about duplicate tests
if options.get().warn_test_name_dupes == true then
-- warn about duplicate tests
local test_dupes = {}
for pos_id, test_data in pairs(d) do
if test_data.duplicate_test_detected == true then
vim.notify(
"Duplicate test name detected: "
.. test_data.gotest_data.pkg
.. "/"
.. test_data.gotest_data.name,
vim.log.levels.WARN
table.insert(
test_dupes,
test_data.gotest_data.pkg .. "/" .. test_data.gotest_data.name
)
end
end
vim.notify(
"Duplicate test name(s) detected:\n" .. table.concat(test_dupes, "\n"),
vim.log.levels.WARN
)
end
end

Expand Down

0 comments on commit 64ee645

Please sign in to comment.