mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
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 7ed2122622
``
* 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
This commit is contained in:
@@ -3,6 +3,7 @@ local Screen = require('test.functional.ui.screen')
|
|||||||
|
|
||||||
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
|
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
|
||||||
local command = helpers.command
|
local command = helpers.command
|
||||||
|
local retry = helpers.retry
|
||||||
|
|
||||||
describe('ui mode_change event', function()
|
describe('ui mode_change event', function()
|
||||||
local screen
|
local screen
|
||||||
@@ -61,30 +62,36 @@ describe('ui mode_change event', function()
|
|||||||
|
|
|
|
||||||
]], mode="normal"}
|
]], mode="normal"}
|
||||||
|
|
||||||
|
local matchtime = 0
|
||||||
command("set showmatch")
|
command("set showmatch")
|
||||||
command("set matchtime=2") -- tenths of seconds
|
retry(nil, nil, function()
|
||||||
feed('a(stuff')
|
matchtime = matchtime + 1
|
||||||
screen:expect{grid=[[
|
local screen_timeout = 1000 * matchtime -- fail faster for retry.
|
||||||
word(stuff^ |
|
|
||||||
{0:~ }|
|
|
||||||
{0:~ }|
|
|
||||||
{2:-- INSERT --} |
|
|
||||||
]], mode="insert"}
|
|
||||||
|
|
||||||
feed(')')
|
command("set matchtime=" .. matchtime) -- tenths of seconds
|
||||||
screen:expect{grid=[[
|
feed('a(stuff')
|
||||||
word^(stuff) |
|
screen:expect{grid=[[
|
||||||
{0:~ }|
|
word(stuff^ |
|
||||||
{0:~ }|
|
{0:~ }|
|
||||||
{2:-- INSERT --} |
|
{0:~ }|
|
||||||
]], mode="showmatch"}
|
{2:-- INSERT --} |
|
||||||
|
]], mode="insert", timeout=screen_timeout}
|
||||||
|
|
||||||
screen:expect{grid=[[
|
feed(')')
|
||||||
word(stuff)^ |
|
screen:expect{grid=[[
|
||||||
{0:~ }|
|
word^(stuff) |
|
||||||
{0:~ }|
|
{0:~ }|
|
||||||
{2:-- INSERT --} |
|
{0:~ }|
|
||||||
]], mode="insert"}
|
{2:-- INSERT --} |
|
||||||
|
]], mode="showmatch", timeout=screen_timeout}
|
||||||
|
|
||||||
|
screen:expect{grid=[[
|
||||||
|
word(stuff)^ |
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{2:-- INSERT --} |
|
||||||
|
]], mode="insert", timeout=screen_timeout}
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('works in replace mode', function()
|
it('works in replace mode', function()
|
||||||
|
|||||||
@@ -915,6 +915,7 @@ local function screen_tests(linegrid)
|
|||||||
|
|
||||||
-- Regression test for #8357
|
-- Regression test for #8357
|
||||||
it('does not have artifacts after temporary chars in insert mode', function()
|
it('does not have artifacts after temporary chars in insert mode', function()
|
||||||
|
command('set timeoutlen=10000')
|
||||||
command('inoremap jk <esc>')
|
command('inoremap jk <esc>')
|
||||||
feed('ifooj')
|
feed('ifooj')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
|
|||||||
Reference in New Issue
Block a user