mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
test: fix state() test flakiness (#24839)
This commit is contained in:
parent
b84a67f50e
commit
20f76ebf2b
@ -41,18 +41,20 @@ describe('state() function', function()
|
|||||||
|
|
||||||
-- Using a timer callback
|
-- Using a timer callback
|
||||||
feed([[:call RunTimer()<CR>]])
|
feed([[:call RunTimer()<CR>]])
|
||||||
poke_eventloop() -- Allow polling for events
|
poke_eventloop() -- Process pending input
|
||||||
|
poke_eventloop() -- Process time_event
|
||||||
eq({ 'c', 'n' }, exec_lua('return _G.res'))
|
eq({ 'c', 'n' }, exec_lua('return _G.res'))
|
||||||
|
|
||||||
-- Halfway a mapping
|
-- Halfway a mapping
|
||||||
feed([[:call v:lua.Run_timer()<CR>;]])
|
feed([[:call v:lua.Run_timer()<CR>;]])
|
||||||
meths.get_mode() -- Allow polling for fast events
|
meths.get_mode() -- Process pending input and luv timer callback
|
||||||
feed(';')
|
feed(';')
|
||||||
eq({ 'mS', 'n' }, exec_lua('return _G.res'))
|
eq({ 'mS', 'n' }, exec_lua('return _G.res'))
|
||||||
|
|
||||||
-- Insert mode completion
|
-- Insert mode completion
|
||||||
feed([[:call RunTimer()<CR>Got<C-N>]])
|
feed([[:call RunTimer()<CR>Got<C-N>]])
|
||||||
poke_eventloop() -- Allow polling for events
|
poke_eventloop() -- Process pending input
|
||||||
|
poke_eventloop() -- Process time_event
|
||||||
feed('<Esc>')
|
feed('<Esc>')
|
||||||
eq({ 'aSc', 'i' }, exec_lua('return _G.res'))
|
eq({ 'aSc', 'i' }, exec_lua('return _G.res'))
|
||||||
|
|
||||||
@ -62,7 +64,7 @@ describe('state() function', function()
|
|||||||
|
|
||||||
-- messages scrolled
|
-- messages scrolled
|
||||||
feed([[:call v:lua.Run_timer() | echo "one\ntwo\nthree"<CR>]])
|
feed([[:call v:lua.Run_timer() | echo "one\ntwo\nthree"<CR>]])
|
||||||
meths.get_mode() -- Allow polling for fast events
|
meths.get_mode() -- Process pending input and luv timer callback
|
||||||
feed('<CR>')
|
feed('<CR>')
|
||||||
eq({ 'Ss', 'r' }, exec_lua('return _G.res'))
|
eq({ 'Ss', 'r' }, exec_lua('return _G.res'))
|
||||||
end)
|
end)
|
||||||
|
Loading…
Reference in New Issue
Block a user