aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/mode_spec.lua
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2019-09-26 07:37:51 +0200
committerGitHub <noreply@github.com>2019-09-26 07:37:51 +0200
commit54c66e636aa7c9f9379c0028e62c7d6d617f691c (patch)
tree74973e06da72c0f8df43282561e6f47f5c0bc712 /test/functional/ui/mode_spec.lua
parentcb252071718a58c2d9747177ebeb81ff1210ddd1 (diff)
downloadrneovim-54c66e636aa7c9f9379c0028e62c7d6d617f691c.tar.gz
rneovim-54c66e636aa7c9f9379c0028e62c7d6d617f691c.tar.bz2
rneovim-54c66e636aa7c9f9379c0028e62c7d6d617f691c.zip
Fix two more flaky tests (#11095)
* mode_spec: retry with increasing matchtime `matchtime=2` might still be too low (with luacov on AppVeyor). [ ERROR ] test/functional\ui\mode_spec.lua @ 47: ui mode_change event works in insert mode test\functional\ui\screen.lua:587: mode Expected objects to be the same. Passed in: (string) 'insert' Expected: (string) 'showmatch' Hint: full state of "mode": "insert" Followup to fe60013fb. ref #10941 Initially regressed in 7ed212262242 `` * ui/screen_basic_spec: set timeoutlen=10000 This fixes the test on slow CI. Ref: https://ci.appveyor.com/project/neovim/neovim/builds/27600387/job/t468h2b3w9lwtlm5#L10930
Diffstat (limited to 'test/functional/ui/mode_spec.lua')
-rw-r--r--test/functional/ui/mode_spec.lua53
1 files changed, 30 insertions, 23 deletions
diff --git a/test/functional/ui/mode_spec.lua b/test/functional/ui/mode_spec.lua
index 200f6eecdb..9390f268b3 100644
--- a/test/functional/ui/mode_spec.lua
+++ b/test/functional/ui/mode_spec.lua
@@ -3,6 +3,7 @@ local Screen = require('test.functional.ui.screen')
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
local command = helpers.command
+local retry = helpers.retry
describe('ui mode_change event', function()
local screen
@@ -61,30 +62,36 @@ describe('ui mode_change event', function()
|
]], mode="normal"}
+ local matchtime = 0
command("set showmatch")
- command("set matchtime=2") -- tenths of seconds
- feed('a(stuff')
- screen:expect{grid=[[
- word(stuff^ |
- {0:~ }|
- {0:~ }|
- {2:-- INSERT --} |
- ]], mode="insert"}
-
- feed(')')
- screen:expect{grid=[[
- word^(stuff) |
- {0:~ }|
- {0:~ }|
- {2:-- INSERT --} |
- ]], mode="showmatch"}
-
- screen:expect{grid=[[
- word(stuff)^ |
- {0:~ }|
- {0:~ }|
- {2:-- INSERT --} |
- ]], mode="insert"}
+ retry(nil, nil, function()
+ matchtime = matchtime + 1
+ local screen_timeout = 1000 * matchtime -- fail faster for retry.
+
+ command("set matchtime=" .. matchtime) -- tenths of seconds
+ feed('a(stuff')
+ screen:expect{grid=[[
+ word(stuff^ |
+ {0:~ }|
+ {0:~ }|
+ {2:-- INSERT --} |
+ ]], mode="insert", timeout=screen_timeout}
+
+ feed(')')
+ screen:expect{grid=[[
+ word^(stuff) |
+ {0:~ }|
+ {0:~ }|
+ {2:-- INSERT --} |
+ ]], mode="showmatch", timeout=screen_timeout}
+
+ screen:expect{grid=[[
+ word(stuff)^ |
+ {0:~ }|
+ {0:~ }|
+ {2:-- INSERT --} |
+ ]], mode="insert", timeout=screen_timeout}
+ end)
end)
it('works in replace mode', function()