aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/window_spec.lua
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2015-02-12 14:06:18 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2015-02-16 23:17:38 -0300
commite974b002833ba28ea69bc0969e21926e4e7d301f (patch)
tree5569fc401ce775d40e50a4fe1174a099a5f4664c /test/functional/api/window_spec.lua
parente6208df73e39e281331141373c22a83bca6beccd (diff)
downloadrneovim-e974b002833ba28ea69bc0969e21926e4e7d301f.tar.gz
rneovim-e974b002833ba28ea69bc0969e21926e4e7d301f.tar.bz2
rneovim-e974b002833ba28ea69bc0969e21926e4e7d301f.zip
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.
Diffstat (limited to 'test/functional/api/window_spec.lua')
-rw-r--r--test/functional/api/window_spec.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/functional/api/window_spec.lua b/test/functional/api/window_spec.lua
index f3ac90de21..456252522d 100644
--- a/test/functional/api/window_spec.lua
+++ b/test/functional/api/window_spec.lua
@@ -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))