changeset 12198:65cff399750b v8.0.0979

patch 8.0.0979: terminal noblock test fails on MS-Windows commit https://github.com/vim/vim/commit/eef0531621c8d4045d669eb815b051d925983df8 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Aug 20 20:21:23 2017 +0200 patch 8.0.0979: terminal noblock test fails on MS-Windows Problem: Terminal noblock test fails on MS-Windows. (Christian Brabandt) Solution: Ignore empty line below "done".
author Christian Brabandt <cb@256bit.org>
date Sun, 20 Aug 2017 20:30:03 +0200
parents 52afff0db6b2
children 5040c9c973c9
files src/testdir/test_terminal.vim src/version.c
diffstat 2 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -458,9 +458,16 @@ func Test_terminal_noblock()
     call term_sendkeys(g:buf, 'echo ' . repeat(c, 5000) . "\<cr>")
   endfor
   call term_sendkeys(g:buf, "echo done\<cr>")
+
+  " On MS-Windows there is an extra empty line below "done".  Find "done" in
+  " the last-but-one or the last-but-two line.
   let g:lnum = term_getsize(g:buf)[0] - 1
-  call WaitFor('term_getline(g:buf, g:lnum) =~ "done"', 3000)
-  call assert_match('done', term_getline(g:buf, g:lnum))
+  call WaitFor('term_getline(g:buf, g:lnum) =~ "done" || term_getline(g:buf, g:lnum - 1) =~ "done"', 3000)
+  let line = term_getline(g:buf, g:lnum)
+  if line !~ 'done'
+    let line = term_getline(g:buf, g:lnum - 1)
+  endif
+  call assert_match('done', line)
 
   let g:job = term_getjob(g:buf)
   call Stop_shell_in_terminal(g:buf)
--- a/src/version.c
+++ b/src/version.c
@@ -770,6 +770,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    979,
+/**/
     978,
 /**/
     977,