aboutsummaryrefslogtreecommitdiff
path: root/test/functional/vimscript/state_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-08-23 06:42:10 +0800
committerGitHub <noreply@github.com>2023-08-23 06:42:10 +0800
commit6462ee1c10f9f1aa66ffc4d4fe1b7b3d9f0f91af (patch)
tree3d65da7025785f89e0c7743147d223233f3ca750 /test/functional/vimscript/state_spec.lua
parent20f76ebf2b5aec799b0f90e5e892a4b88597d427 (diff)
downloadrneovim-6462ee1c10f9f1aa66ffc4d4fe1b7b3d9f0f91af.tar.gz
rneovim-6462ee1c10f9f1aa66ffc4d4fe1b7b3d9f0f91af.tar.bz2
rneovim-6462ee1c10f9f1aa66ffc4d4fe1b7b3d9f0f91af.zip
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 https://github.com/vim/vim/commit/8dabccd295271104ad5af0abc48e283d644cff59
Diffstat (limited to 'test/functional/vimscript/state_spec.lua')
-rw-r--r--test/functional/vimscript/state_spec.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/functional/vimscript/state_spec.lua b/test/functional/vimscript/state_spec.lua
index 1acfb1337d..0508b8b1da 100644
--- a/test/functional/vimscript/state_spec.lua
+++ b/test/functional/vimscript/state_spec.lua
@@ -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