mirror of
https://github.com/neovim/neovim.git
synced 2025-11-17 15:51:32 +00:00
vim-patch:9.0.1779: Need more state() tests (#24840)
Problem: Need more state() tests
Solution: Add a few more tests for operater pending mode and register
yank command
closes: vim/vim#12883
8dabccd295
This commit is contained in:
@@ -10,6 +10,7 @@ local poke_eventloop = helpers.poke_eventloop
|
||||
before_each(clear)
|
||||
|
||||
describe('state() function', function()
|
||||
-- oldtest: Test_state()
|
||||
it('works', function()
|
||||
meths.ui_attach(80, 24, {}) -- Allow hit-enter-prompt
|
||||
|
||||
@@ -51,6 +52,20 @@ describe('state() function', function()
|
||||
feed(';')
|
||||
eq({ 'mS', 'n' }, exec_lua('return _G.res'))
|
||||
|
||||
-- An operator is pending
|
||||
feed([[:call RunTimer()<CR>y]])
|
||||
poke_eventloop() -- Process pending input
|
||||
poke_eventloop() -- Process time_event
|
||||
feed('y')
|
||||
eq({ 'oSc', 'n' }, exec_lua('return _G.res'))
|
||||
|
||||
-- A register was specified
|
||||
feed([[:call RunTimer()<CR>"r]])
|
||||
poke_eventloop() -- Process pending input
|
||||
poke_eventloop() -- Process time_event
|
||||
feed('yy')
|
||||
eq({ 'oSc', 'n' }, exec_lua('return _G.res'))
|
||||
|
||||
-- Insert mode completion
|
||||
feed([[:call RunTimer()<CR>Got<C-N>]])
|
||||
poke_eventloop() -- Process pending input
|
||||
|
||||
Reference in New Issue
Block a user