mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
test(undo_spec): add more tests for writing in Insert mode
(cherry picked from commit 95044991e6
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
eacc8230ed
commit
cf7ae5f2f9
@@ -10,6 +10,7 @@ local feed_command = helpers.feed_command
|
||||
local insert = helpers.insert
|
||||
local funcs = helpers.funcs
|
||||
local exec = helpers.exec
|
||||
local exec_lua = helpers.exec_lua
|
||||
|
||||
local function lastmessage()
|
||||
local messages = funcs.split(funcs.execute('messages'), '\n')
|
||||
@@ -101,6 +102,45 @@ describe('u CTRL-R g- g+', function()
|
||||
feed('u')
|
||||
expect('')
|
||||
end)
|
||||
|
||||
it('using Lua mapping', function()
|
||||
exec_lua([[
|
||||
vim.api.nvim_set_keymap('i', '.', '', {callback = function()
|
||||
vim.cmd('write')
|
||||
end})
|
||||
]])
|
||||
feed('Otest.<CR>boo!!!<Esc>')
|
||||
expect([[
|
||||
test
|
||||
boo!!!
|
||||
]])
|
||||
|
||||
feed('u')
|
||||
expect([[
|
||||
test
|
||||
]])
|
||||
|
||||
feed('u')
|
||||
expect('')
|
||||
end)
|
||||
|
||||
it('using RPC call', function()
|
||||
feed('Otest')
|
||||
command('write')
|
||||
feed('<CR>boo!!!<Esc>')
|
||||
expect([[
|
||||
test
|
||||
boo!!!
|
||||
]])
|
||||
|
||||
feed('u')
|
||||
expect([[
|
||||
test
|
||||
]])
|
||||
|
||||
feed('u')
|
||||
expect('')
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
||||
|
Reference in New Issue
Block a user