]> granicus.if.org Git - vim/commitdiff
patch 8.2.1497: CursorHold test is flaky v8.2.1497
authorBram Moolenaar <Bram@vim.org>
Thu, 20 Aug 2020 16:29:13 +0000 (18:29 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 20 Aug 2020 16:29:13 +0000 (18:29 +0200)
Problem:    CursorHold test is flaky. (Jakub Kądziołka)
Solution:   Use WaitForAssert() (closes #6754)

src/testdir/test_autocmd.vim
src/version.c

index ca8cc04c2d42b921481c0b6cb6fa0eab78b773a8..73674a288792bdc01b32ff2c5536759e5ea49456 100644 (file)
@@ -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')
index c2057b318d9040848b59d8e5a7dfda68d6aaeae5..28400fbff2a434f41025151d5a4e27b749523051 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1497,
 /**/
     1496,
 /**/