mirror of
https://github.com/neovim/neovim.git
synced 2026-02-21 01:40:19 +10:00
test: add tests for #14379
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -2169,6 +2169,22 @@ describe('TUI', function()
|
||||
screen:expect({ any = vim.pesc('[Process exited 1]') })
|
||||
end)
|
||||
|
||||
it('exits properly when :quit non-last window in event handler #14379', function()
|
||||
local code = [[
|
||||
vim.defer_fn(function()
|
||||
vim.cmd('vsplit | quit')
|
||||
end, 0)
|
||||
vim.cmd('quit')
|
||||
]]
|
||||
child_session:notify('nvim_exec_lua', code, {})
|
||||
screen:expect([[
|
||||
|
|
||||
[Process exited 0]^ |
|
||||
|*4
|
||||
{3:-- TERMINAL --} |
|
||||
]])
|
||||
end)
|
||||
|
||||
it('no stack-use-after-scope with cursor color #22432', function()
|
||||
screen:set_option('rgb', true)
|
||||
command('set termguicolors')
|
||||
|
||||
Reference in New Issue
Block a user