test: add tests for #14379

This commit is contained in:
zeertzjq
2026-01-20 06:32:32 +08:00
parent 537e8d69f8
commit 9ba985c250
2 changed files with 44 additions and 0 deletions

View File

@@ -118,3 +118,31 @@ describe(':cquit', function()
)
end)
end)
describe('no crash after :quit non-last window during exit', function()
before_each(function()
n.clear()
end)
it('in vim.schedule() callback and when piping to stdin #14379', function()
n.fn.system({
n.nvim_prog,
'-es',
'--cmd',
"lua vim.schedule(function() vim.cmd('vsplit | quit') end)",
'+quit',
}, '')
eq(0, n.api.nvim_get_vvar('shell_error'))
end)
it('in vim.defer_fn() callback and when piping to stdin #14379', function()
n.fn.system({
n.nvim_prog,
'-es',
'--cmd',
"lua vim.defer_fn(function() vim.cmd('vsplit | quit') end, 0)",
'+quit',
}, '')
eq(0, n.api.nvim_get_vvar('shell_error'))
end)
end)