From 883b92b63d91e6b868455ce5eff74db8f3b967f0 Mon Sep 17 00:00:00 2001 From: Oleksandr Smirnov Date: Wed, 26 Feb 2025 13:26:44 +0200 Subject: [PATCH] refactor(gotests): use new runner --- lua/gopher/gotests.lua | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/lua/gopher/gotests.lua b/lua/gopher/gotests.lua index 1c177b6..e97f26c 100644 --- a/lua/gopher/gotests.lua +++ b/lua/gopher/gotests.lua @@ -67,16 +67,12 @@ local function add_test(args) log.debug("generating tests with args: ", args) - return r.sync(c.commands.gotests, { - args = args, - on_exit = function(data, status) - if not status == 0 then - error("gotests failed: " .. data) - end + local rs = r.sync { c.commands.gotests, unpack(args) } + if rs.code ~= 0 then + error("gotests failed: " .. rs.stderr) + end - u.notify "unit test(s) generated" - end, - }) + u.notify "unit test(s) generated" end -- generate unit test for one function