To: vim_dev@googlegroups.com Subject: Patch 8.2.1497 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1497 Problem: CursorHold test is flaky. (Jakub Kądziołka) Solution: Use WaitForAssert() (closes #6754) Files: src/testdir/test_autocmd.vim *** ../vim-8.2.1496/src/testdir/test_autocmd.vim 2020-08-12 18:50:31.871655841 +0200 --- src/testdir/test_autocmd.vim 2020-08-20 18:26:41.149243377 +0200 *************** *** 29,48 **** END call writefile(before, 'Xinit') let buf = RunVimInTerminal('-S Xinit Xfile', {}) ! call term_wait(buf) call term_sendkeys(buf, "gg") call term_wait(buf) ! sleep 50m call term_sendkeys(buf, "j") call term_wait(buf) ! sleep 50m call term_sendkeys(buf, "j") call term_wait(buf) ! sleep 50m call StopVimInTerminal(buf) - call assert_equal(['1', '2', '3'], readfile('Xoutput')[-3:-1]) - call delete('Xinit') call delete('Xoutput') call delete('Xfile') --- 29,47 ---- END call writefile(before, 'Xinit') let buf = RunVimInTerminal('-S Xinit Xfile', {}) ! call term_sendkeys(buf, "G") ! call term_wait(buf, 20) call term_sendkeys(buf, "gg") call term_wait(buf) ! call WaitForAssert({-> assert_equal(['1'], readfile('Xoutput')[-1:-1])}) call term_sendkeys(buf, "j") call term_wait(buf) ! call WaitForAssert({-> assert_equal(['1', '2'], readfile('Xoutput')[-2:-1])}) call term_sendkeys(buf, "j") call term_wait(buf) ! call WaitForAssert({-> assert_equal(['1', '2', '3'], readfile('Xoutput')[-3:-1])}) call StopVimInTerminal(buf) call delete('Xinit') call delete('Xoutput') call delete('Xfile') *** ../vim-8.2.1496/src/version.c 2020-08-20 18:02:42.715595020 +0200 --- src/version.c 2020-08-20 18:27:58.348643827 +0200 *************** *** 756,757 **** --- 756,759 ---- { /* Add new patch number below this line */ + /**/ + 1497, /**/ -- Vi is clearly superior to emacs, since "vi" has only two characters (and two keystrokes), while "emacs" has five. (Randy C. Ford) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///