Mercurial > vim
changeset 21895:0ae284aaa8a2 v8.2.1497
patch 8.2.1497: CursorHold test is flaky
Commit: https://github.com/vim/vim/commit/17f67547f36a06220ea4667aaee7bb130108f568
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Aug 20 18:29:13 2020 +0200
patch 8.2.1497: CursorHold test is flaky
Problem: CursorHold test is flaky. (Jakub K?dzio?ka)
Solution: Use WaitForAssert() (closes https://github.com/vim/vim/issues/6754)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 20 Aug 2020 18:30:04 +0200 |
parents | 0a3a52ec5f4c |
children | 4f7b50471a6a |
files | src/testdir/test_autocmd.vim src/version.c |
diffstat | 2 files changed, 7 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/testdir/test_autocmd.vim +++ b/src/testdir/test_autocmd.vim @@ -29,20 +29,19 @@ func Test_CursorHold_autocmd() END call writefile(before, 'Xinit') let buf = RunVimInTerminal('-S Xinit Xfile', {}) - call term_wait(buf) + call term_sendkeys(buf, "G") + call term_wait(buf, 20) call term_sendkeys(buf, "gg") call term_wait(buf) - sleep 50m + call WaitForAssert({-> assert_equal(['1'], readfile('Xoutput')[-1:-1])}) call term_sendkeys(buf, "j") call term_wait(buf) - sleep 50m + call WaitForAssert({-> assert_equal(['1', '2'], readfile('Xoutput')[-2:-1])}) call term_sendkeys(buf, "j") call term_wait(buf) - sleep 50m + call WaitForAssert({-> assert_equal(['1', '2', '3'], readfile('Xoutput')[-3:-1])}) call StopVimInTerminal(buf) - call assert_equal(['1', '2', '3'], readfile('Xoutput')[-3:-1]) - call delete('Xinit') call delete('Xoutput') call delete('Xfile')