]> granicus.if.org Git - vim/commitdiff
patch 8.2.2648: terminal resize test sometimes hangs v8.2.2648
authorBram Moolenaar <Bram@vim.org>
Tue, 23 Mar 2021 18:22:12 +0000 (19:22 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 23 Mar 2021 18:22:12 +0000 (19:22 +0100)
Problem:    Terminal resize test sometimes hangs.
Solution:   Wait for the shell to display a prompt and other output.

src/testdir/test_terminal2.vim
src/version.c

index 4dc8350240aea4907d1cef3510854b5e558aac9b..0f8dcb672e200e630ddcb69f74dda1935865d3db 100644 (file)
@@ -246,6 +246,10 @@ func Test_terminal_resize()
   set statusline=x
   terminal
   call assert_equal(2, winnr('$'))
+  let buf = bufnr()
+
+  " Wait for the shell to display a prompt
+  call WaitForAssert({-> assert_notequal('', term_getline(buf, 1))})
 
   " Fill the terminal with text.
   if has('win32')
@@ -253,6 +257,9 @@ func Test_terminal_resize()
   else
     call feedkeys("ls\<CR>", 'xt')
   endif
+  " Wait for some output
+  call WaitForAssert({-> assert_notequal('', term_getline(buf, 3))})
+
   " Go to Terminal-Normal mode for a moment.
   call feedkeys("\<C-W>N", 'xt')
   " Open a new window
@@ -263,6 +270,7 @@ func Test_terminal_resize()
   close
   call assert_equal(2, winnr('$'))
   call feedkeys("exit\<CR>", 'xt')
+  call TermWait(buf)
   set statusline&
 endfunc
 
index 750db2ef6e837a07785aa07c8bbffa080121d19f..b2b0beb731a9cdac93febc5632cb3e1f69c7c2cd 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2648,
 /**/
     2647,
 /**/