]> granicus.if.org Git - vim/commitdiff
patch 8.2.3789: Test_window_minimal_size can fail on a slow machine v8.2.3789
authorichizok <gclient.gaap@gmail.com>
Sun, 12 Dec 2021 16:42:09 +0000 (16:42 +0000)
committerBram Moolenaar <Bram@vim.org>
Sun, 12 Dec 2021 16:42:09 +0000 (16:42 +0000)
Problem:    Test_window_minimal_size can fail on a slow machine.
Solution:   Do not rely on timers firing at the expected time. (Ozaki Kiichi,
            closes #9335)

src/testdir/test_window_cmd.vim
src/version.c

index 68c44a0c386802af922f52678a6871b9da124221..a55567f9091fe458a12cb2722e6a664f78c4f1cd 100644 (file)
@@ -1379,13 +1379,17 @@ func Test_window_minimal_size()
 
   if has('timers')
     " check size is fixed in Insert mode
+    func s:CheckSize(timer) abort
+      call win_execute(win_getid(2), 'wincmd _')
+      call assert_equal(0, winheight(0))
+      call feedkeys(" \<Esc>", 't!')
+    endfunc
     new
-    call timer_start(100, {_ -> win_execute(win_getid(2), 'wincmd _')})
-    call timer_start(200, {_ -> assert_equal(0, winheight(0))})
-    call timer_start(300, {_ -> feedkeys(" \<Esc>", 't!')})
+    call timer_start(100, function('s:CheckSize'))
     call feedkeys('a', 'tx!')
     call assert_equal(1, winheight(0))
     bwipe!
+    delfunc s:CheckSize
   endif
 
   set winminwidth& winminheight&
index 09bbb915519ffd2d4f63eba6560c4a783619bf6a..ac574d530ce8d718c0115fce0d7236f1e6b4c4f7 100644 (file)
@@ -753,6 +753,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3789,
 /**/
     3788,
 /**/