mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 11:58:17 +00:00
test: Fix race condition in window_spec.lua
Without waiting for the 'gg' command to be processed, its possible that the following assertion will fail.
This commit is contained in:
@@ -4,6 +4,7 @@ local clear, nvim, buffer, curbuf, curbuf_contents, window, curwin, eq, neq,
|
||||
ok, feed, rawfeed, insert, eval = helpers.clear, helpers.nvim, helpers.buffer, helpers.curbuf,
|
||||
helpers.curbuf_contents, helpers.window, helpers.curwin, helpers.eq,
|
||||
helpers.neq, helpers.ok, helpers.feed, helpers.rawfeed, helpers.insert, helpers.eval
|
||||
local wait = helpers.wait
|
||||
|
||||
-- check if str is visible at the beginning of some line
|
||||
local function is_visible(str)
|
||||
@@ -55,6 +56,7 @@ describe('window_* functions', function()
|
||||
insert("epilogue")
|
||||
win = curwin()
|
||||
feed('gg')
|
||||
wait() -- let nvim process the 'gg' command
|
||||
|
||||
-- cursor position is at beginning
|
||||
eq({1, 0}, window('get_cursor', win))
|
||||
|
Reference in New Issue
Block a user