Skip to content

Commit

Permalink
test/functional/ui/mode_spec: improve "ui mode_change event" (neovim#…
Browse files Browse the repository at this point in the history
…10816)

Set a shorter `&matchtime` (instead of asserting the default), and do
not sleep - `screen:expect` will do that (wait for it).
  • Loading branch information
blueyed authored Aug 20, 2019
1 parent 57e19ea commit 7ed2122
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/functional/ui/mode_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')

local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
local command, eval = helpers.command, helpers.eval
local eq = helpers.eq
local command = helpers.command

describe('ui mode_change event', function()
local screen
Expand Down Expand Up @@ -63,7 +62,7 @@ describe('ui mode_change event', function()
]], mode="normal"}

command("set showmatch")
eq(eval('&matchtime'), 5) -- tenths of seconds
command("set matchtime=1") -- tenths of seconds
feed('a(stuff')
screen:expect{grid=[[
word(stuff^ |
Expand All @@ -80,7 +79,6 @@ describe('ui mode_change event', function()
{2:-- INSERT --} |
]], mode="showmatch"}

screen:sleep(400)
screen:expect{grid=[[
word(stuff)^ |
{0:~ }|
Expand Down

0 comments on commit 7ed2122

Please sign in to comment.