mirror of
https://github.com/neovim/neovim.git
synced 2026-07-31 04:39:07 +00:00
test: unreliable "CursorHold not triggered after only K_EVENT on startup" #40863
Problem:
FAILED …/cursorhold_spec.lua @ 73: CursorHold is not triggered after only K_EVENT on startup
Expected values to be equal.
Expected:
1
Actual:
0
stack traceback:
…/cursorhold_spec.lua:79: in function <…/cursorhold_spec.lua:73>
Solution:
Retry instead of hardcoding sleep(50).
This commit is contained in:
@@ -75,8 +75,10 @@ describe('CursorHold', function()
|
||||
sleep(50)
|
||||
eq(0, api.nvim_get_var('cursorhold'))
|
||||
feed('0')
|
||||
sleep(50)
|
||||
eq(1, api.nvim_get_var('cursorhold'))
|
||||
-- Poll: CursorHold may take longer than one 'updatetime' to fire.
|
||||
retry(nil, 1000, function()
|
||||
eq(1, api.nvim_get_var('cursorhold'))
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user