diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-08-19 15:40:01 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-08-19 15:40:01 +0200 |
commit | d21f8b54b24e08d1f2b7c6ae32a9bc75ac4fa9fc (patch) | |
tree | 4c23d3902cc2fede7bd2df4b939b598496f861e1 /src/testdir | |
parent | 9aa156912867c05e0a6480925afe11c590378f09 (diff) | |
download | vim-d21f8b54b24e08d1f2b7c6ae32a9bc75ac4fa9fc.zip |
patch 8.0.0963: terminal test fails on MacOS
Problem: Terminal test fails on MacOS. (chdiza)
Solution: Wait for the shell to echo the characters. (closes #1991)
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_terminal.vim | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim index 64104abeb..e737aead9 100644 --- a/src/testdir/test_terminal.vim +++ b/src/testdir/test_terminal.vim @@ -452,14 +452,21 @@ func Test_terminal_list_args() endfunction func Test_terminal_noblock() - let buf = term_start(&shell) + let g:buf = term_start(&shell) for c in ['a','b','c','d','e','f','g','h','i','j','k'] - call term_sendkeys(buf, 'echo ' . repeat(c, 5000) . "\<cr>") + call term_sendkeys(g:buf, 'echo ' . repeat(c, 5000) . "\<cr>") endfor + call term_sendkeys(g:buf, "echo done\<cr>") + 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)) - let g:job = term_getjob(buf) - call Stop_shell_in_terminal(buf) - call term_wait(buf) + let g:job = term_getjob(g:buf) + call Stop_shell_in_terminal(g:buf) + call term_wait(g:buf) + unlet g:buf + unlet g:job + unlet g:lnum bwipe endfunc |