Skip to content

Commit 30ba09a

Browse files
committed
ci: fix headless tests on nightly
ref: neovim/neovim#37987
1 parent d9508cc commit 30ba09a

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

tests/headless_spec.lua

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,19 @@ local exec_term = function(c, cmd, args)
4545
eq(tonumber(id) > 0, true)
4646
c.lua(string.format("vim.fn.jobwait({%s})", tostring(id)))
4747
c.wait_until(function()
48-
local lines = c.get_lines()
49-
for i = #lines, 1, -1 do
50-
if lines[i] == "" then
51-
table.remove(lines, i)
48+
if FzfLua.utils.__HAS_NVIM_012 then
49+
-- https://github.com/neovim/neovim/pull/37987
50+
local exitcode = c.lua_get("vim.api.nvim_get_chan_info(vim.bo.channel).exitcode")
51+
return tonumber(exitcode) == 0
52+
else
53+
local lines = c.get_lines()
54+
for i = #lines, 1, -1 do
55+
if lines[i] == "" then
56+
table.remove(lines, i)
57+
end
5258
end
59+
return lines[#lines] == "[Process exited 0]"
5360
end
54-
return lines[#lines] == "[Process exited 0]"
5561
end)
5662
end
5763

0 commit comments

Comments
 (0)