diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-11-18 06:47:51 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-18 06:47:51 +0800 |
commit | 510429fc5cc010afa54036d16e049b177cce2e3e (patch) | |
tree | a699698dfc29245c95e18e1dab3af4d7a5ed8d74 /src | |
parent | 7b158e766b4f00c45c08acc40ca4a30db86cec37 (diff) | |
download | rneovim-510429fc5cc010afa54036d16e049b177cce2e3e.tar.gz rneovim-510429fc5cc010afa54036d16e049b177cce2e3e.tar.bz2 rneovim-510429fc5cc010afa54036d16e049b177cce2e3e.zip |
vim-patch:8.2.1497: CursorHold test is flaky (#21095)
Problem: CursorHold test is flaky. (Jakub Kądziołka)
Solution: Use WaitForAssert() (closes vim/vim#6754)
https://github.com/vim/vim/commit/17f67547f36a06220ea4667aaee7bb130108f568
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/testdir/test_autocmd.vim | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/nvim/testdir/test_autocmd.vim b/src/nvim/testdir/test_autocmd.vim index fb8adbb3a6..70da0a9ba2 100644 --- a/src/nvim/testdir/test_autocmd.vim +++ b/src/nvim/testdir/test_autocmd.vim @@ -31,20 +31,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') |