refactor(gotests): use vim.system
This commit is contained in:
parent
ec91e6efcc
commit
f4e20f1a51
1 changed files with 5 additions and 9 deletions
|
|
@ -67,16 +67,12 @@ local function add_test(args)
|
||||||
|
|
||||||
log.debug("generating tests with args: ", args)
|
log.debug("generating tests with args: ", args)
|
||||||
|
|
||||||
return r.sync(c.commands.gotests, {
|
local rs = r.sync { c.commands.gotests, unpack(args) }
|
||||||
args = args,
|
if rs.code ~= 0 then
|
||||||
on_exit = function(data, status)
|
error("gotests failed: " .. rs.stderr)
|
||||||
if not status == 0 then
|
|
||||||
error("gotests failed: " .. data)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
u.notify "unit test(s) generated"
|
u.notify "unit test(s) generated"
|
||||||
end,
|
|
||||||
})
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- generate unit test for one function
|
-- generate unit test for one function
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue