mirror of
https://github.com/neovim/neovim.git
synced 2026-05-24 05:40:08 +00:00
test: run Lua harness with nvim -l
Problem: The Lua test harness still ran through standalone -ll mode, so tests depended on the low-level Lua path instead of the regular Nvim Lua environment. That also meant os.exit() coverage had to carry an ASAN workaround because Lua's raw process exit skipped Nvim teardown and let LeakSanitizer interfere with the observed exit code. Solution: Run the harness and related fixtures with nvim -l. Patch os.exit() in the main Lua state to exit through getout(), so scripts observe normal Nvim shutdown while standalone -ll remains available for generator-style scripts. As a consequence, the startup test can assert os.exit() without disabling leak detection. AI-assisted: Codex
This commit is contained in:
committed by
Lewis Russell
parent
706cbbff33
commit
9432e6c1e2
@@ -94,6 +94,13 @@ describe('nvim_ui_send', function()
|
||||
clear()
|
||||
end)
|
||||
|
||||
local function close_pipe(pipe)
|
||||
if not pipe:is_closing() then
|
||||
pipe:read_stop()
|
||||
pipe:close()
|
||||
end
|
||||
end
|
||||
|
||||
it('works with stdout_tty', function()
|
||||
local fds = assert(uv.pipe())
|
||||
|
||||
@@ -110,6 +117,10 @@ describe('nvim_ui_send', function()
|
||||
|
||||
local screen = Screen.new(50, 10, { stdout_tty = true })
|
||||
screen:set_stdout(fds.write)
|
||||
finally(function()
|
||||
screen:detach()
|
||||
close_pipe(read_pipe)
|
||||
end)
|
||||
|
||||
api.nvim_ui_send('Hello world')
|
||||
|
||||
@@ -140,6 +151,10 @@ describe('nvim_ui_send', function()
|
||||
|
||||
local screen = Screen.new(50, 10)
|
||||
screen:set_stdout(fds.write)
|
||||
finally(function()
|
||||
screen:detach()
|
||||
close_pipe(read_pipe)
|
||||
end)
|
||||
|
||||
api.nvim_ui_send('Hello world')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user