summaryrefslogtreecommitdiff
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-08-20 20:21:23 +0200
committerBram Moolenaar <Bram@vim.org>2017-08-20 20:21:23 +0200
commiteef0531621c8d4045d669eb815b051d925983df8 (patch)
tree5fed6d21d71baca36c9a075fa4988cc70ed5efa5 /src/testdir
parent37819ed54064b949b1f205c9f4084ba32e3db8bc (diff)
downloadvim-eef0531621c8d4045d669eb815b051d925983df8.zip
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".
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/test_terminal.vim11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim
index b3868553e..bdc5655d5 100644
--- 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)