mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 03:15:39 +00:00
tests: improve robustness of immediate successes in screen tests
This commit is contained in:
@@ -874,20 +874,23 @@ describe('put command', function()
|
||||
local function bell_test(actions, should_ring)
|
||||
local screen = Screen.new()
|
||||
screen:attach()
|
||||
if should_ring then
|
||||
-- check bell is not set by nvim before the action
|
||||
screen:sleep(50)
|
||||
end
|
||||
helpers.ok(not screen.bell and not screen.visualbell)
|
||||
actions()
|
||||
helpers.wait()
|
||||
screen:wait(function()
|
||||
screen:expect{condition=function()
|
||||
if should_ring then
|
||||
if not screen.bell and not screen.visualbell then
|
||||
return 'Bell was not rung after action'
|
||||
error('Bell was not rung after action')
|
||||
end
|
||||
else
|
||||
if screen.bell or screen.visualbell then
|
||||
return 'Bell was rung after action'
|
||||
error('Bell was rung after action')
|
||||
end
|
||||
end
|
||||
end)
|
||||
end, unchanged=(not should_ring)}
|
||||
screen:detach()
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user