Skip to content

Commit

Permalink
feat: show one accumulated warning 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 d7c005b commit 269ca36
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 @@ -276,19 +276,21 @@ function M.show_warnings(d)
end
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 269ca36

Please sign in to comment.