From fc08644fe0af65925f8affb26bcb642f528c7fcf Mon Sep 17 00:00:00 2001 From: Fredrik Averpil Date: Mon, 24 Jun 2024 18:26:55 +0200 Subject: [PATCH] fix: do not show warning when no problems were found --- lua/neotest-golang/results_dir.lua | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/lua/neotest-golang/results_dir.lua b/lua/neotest-golang/results_dir.lua index d95a963a..2a61c014 100644 --- a/lua/neotest-golang/results_dir.lua +++ b/lua/neotest-golang/results_dir.lua @@ -280,11 +280,13 @@ function M.show_warnings(d) table.insert(position_ids, pos_id) end end - vim.notify( - "Test(s) not associated (not found/executed):\n" - .. table.concat(position_ids, "\n"), - vim.log.levels.DEBUG - ) + if #position_ids > 0 then + vim.notify( + "Test(s) not associated (not found/executed):\n" + .. table.concat(position_ids, "\n"), + vim.log.levels.DEBUG + ) + end end if options.get().warn_test_name_dupes == true then @@ -298,10 +300,12 @@ function M.show_warnings(d) ) end end - vim.notify( - "Duplicate test name(s) detected:\n" .. table.concat(test_dupes, "\n"), - vim.log.levels.WARN - ) + if #test_dupes > 0 then + vim.notify( + "Duplicate test name(s) detected:\n" .. table.concat(test_dupes, "\n"), + vim.log.levels.WARN + ) + end end end