Skip to content

Commit 9e2771f

Browse files
committed
tests: fail with non-zero child exitcode/signal
Ref: neovim/lua-client#44
1 parent b772b86 commit 9e2771f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/functional/helpers.lua

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
require('coxpcall')
2+
local busted = require('busted')
23
local luv = require('luv')
34
local lfs = require('lfs')
45
local mpack = require('mpack')
@@ -832,6 +833,16 @@ return function(after_each)
832833
error(msg[3][2])
833834
end
834835
end
836+
837+
if not session.child_exit then
838+
session:close()
839+
end
840+
if session.child_exit then -- requires newer neovim-lua-client (WIP).
841+
if session.child_exit ~= 0 or session.child_signal ~= 0 then
842+
busted.fail(string.format("child exited non-zero (exitcode=%d, signal=%d)",
843+
session.child_exit, session.child_signal))
844+
end
845+
end
835846
end
836847
end)
837848
end

0 commit comments

Comments
 (0)