diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2017-06-26 14:49:15 +0200 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2018-10-15 20:13:11 +0200 |
commit | c8810a51a3a7ef1185b45c07d93f7e6769c5ab55 (patch) | |
tree | 55e62aa6c09a729c9c34bd5d4d4d40321f982376 /test/functional/normal/put_spec.lua | |
parent | 8fd092f3ff15bf70f84ec0d716c5aaa2c7379fa1 (diff) | |
download | rneovim-c8810a51a3a7ef1185b45c07d93f7e6769c5ab55.tar.gz rneovim-c8810a51a3a7ef1185b45c07d93f7e6769c5ab55.tar.bz2 rneovim-c8810a51a3a7ef1185b45c07d93f7e6769c5ab55.zip |
tests: improve robustness of immediate successes in screen tests
Diffstat (limited to 'test/functional/normal/put_spec.lua')
-rw-r--r-- | test/functional/normal/put_spec.lua | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/test/functional/normal/put_spec.lua b/test/functional/normal/put_spec.lua index 148a35ec6b..29cef13e39 100644 --- a/test/functional/normal/put_spec.lua +++ b/test/functional/normal/put_spec.lua @@ -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 |