mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 11:28:22 +00:00
test/functional/ui/mode_spec: improve "ui mode_change event" (#10816)
Set a shorter `&matchtime` (instead of asserting the default), and do not sleep - `screen:expect` will do that (wait for it).
This commit is contained in:
@@ -2,8 +2,7 @@ local helpers = require('test.functional.helpers')(after_each)
|
|||||||
local Screen = require('test.functional.ui.screen')
|
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, eval = helpers.command, helpers.eval
|
local command = helpers.command
|
||||||
local eq = helpers.eq
|
|
||||||
|
|
||||||
describe('ui mode_change event', function()
|
describe('ui mode_change event', function()
|
||||||
local screen
|
local screen
|
||||||
@@ -63,7 +62,7 @@ describe('ui mode_change event', function()
|
|||||||
]], mode="normal"}
|
]], mode="normal"}
|
||||||
|
|
||||||
command("set showmatch")
|
command("set showmatch")
|
||||||
eq(eval('&matchtime'), 5) -- tenths of seconds
|
command("set matchtime=1") -- tenths of seconds
|
||||||
feed('a(stuff')
|
feed('a(stuff')
|
||||||
screen:expect{grid=[[
|
screen:expect{grid=[[
|
||||||
word(stuff^ |
|
word(stuff^ |
|
||||||
@@ -80,7 +79,6 @@ describe('ui mode_change event', function()
|
|||||||
{2:-- INSERT --} |
|
{2:-- INSERT --} |
|
||||||
]], mode="showmatch"}
|
]], mode="showmatch"}
|
||||||
|
|
||||||
screen:sleep(400)
|
|
||||||
screen:expect{grid=[[
|
screen:expect{grid=[[
|
||||||
word(stuff)^ |
|
word(stuff)^ |
|
||||||
{0:~ }|
|
{0:~ }|
|
||||||
|
Reference in New Issue
Block a user