mirror of
https://github.com/neovim/neovim.git
synced 2025-12-08 07:32:40 +00:00
Test: add functional/autocmd/termclose_spec.lua
This commit is contained in:
28
test/functional/autocmd/termclose_spec.lua
Normal file
28
test/functional/autocmd/termclose_spec.lua
Normal file
@@ -0,0 +1,28 @@
|
||||
local helpers = require('test.functional.helpers')
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
|
||||
local clear, eval, execute, feed, nvim, nvim_dir = helpers.clear, helpers.eval,
|
||||
helpers.execute, helpers.feed, helpers.nvim, helpers.nvim_dir
|
||||
local wait = helpers.wait
|
||||
|
||||
describe('TermClose event', function()
|
||||
before_each(function()
|
||||
clear()
|
||||
nvim('set_option', 'shell', nvim_dir .. '/shell-test')
|
||||
nvim('set_option', 'shellcmdflag', 'EXE')
|
||||
screen = Screen.new(20, 4)
|
||||
screen:attach(false)
|
||||
end)
|
||||
|
||||
it('works as expected', function()
|
||||
execute('autocmd TermClose * echomsg "TermClose works!"')
|
||||
execute('terminal')
|
||||
feed('<c-\\><c-n>')
|
||||
screen:expect([[
|
||||
ready $ |
|
||||
[Process exited 0] |
|
||||
^ |
|
||||
TermClose works! |
|
||||
]])
|
||||
end)
|
||||
end)
|
||||
Reference in New Issue
Block a user