From 64ee645e54f5387bfb6fb8f4a28f783eb2502bf0 Mon Sep 17 00:00:00 2001 From: Fredrik Averpil Date: Mon, 24 Jun 2024 18:05:33 +0200 Subject: [PATCH] chore: show one accumulated error instead of individual ones --- lua/neotest-golang/results_dir.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lua/neotest-golang/results_dir.lua b/lua/neotest-golang/results_dir.lua index caefea7d..5800215f 100644 --- a/lua/neotest-golang/results_dir.lua +++ b/lua/neotest-golang/results_dir.lua @@ -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