comparison src/testdir/test_terminal.vim @ 12166:f512c507b061 v8.0.0963

patch 8.0.0963: terminal test fails on MacOS commit https://github.com/vim/vim/commit/d21f8b54b24e08d1f2b7c6ae32a9bc75ac4fa9fc Author: Bram Moolenaar <Bram@vim.org> Date: Sat Aug 19 15:40:01 2017 +0200 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 https://github.com/vim/vim/issues/1991)
author Christian Brabandt <cb@256bit.org>
date Sat, 19 Aug 2017 15:45:03 +0200
parents ee8ead988f2c
children 6947d5bcf57f
comparison
equal deleted inserted replaced
12165:b5146446134c 12166:f512c507b061
450 exe buf . 'bwipe!' 450 exe buf . 'bwipe!'
451 call assert_equal("", bufname(buf)) 451 call assert_equal("", bufname(buf))
452 endfunction 452 endfunction
453 453
454 func Test_terminal_noblock() 454 func Test_terminal_noblock()
455 let buf = term_start(&shell) 455 let g:buf = term_start(&shell)
456 456
457 for c in ['a','b','c','d','e','f','g','h','i','j','k'] 457 for c in ['a','b','c','d','e','f','g','h','i','j','k']
458 call term_sendkeys(buf, 'echo ' . repeat(c, 5000) . "\<cr>") 458 call term_sendkeys(g:buf, 'echo ' . repeat(c, 5000) . "\<cr>")
459 endfor 459 endfor
460 460 call term_sendkeys(g:buf, "echo done\<cr>")
461 let g:job = term_getjob(buf) 461 let g:lnum = term_getsize(g:buf)[0] - 1
462 call Stop_shell_in_terminal(buf) 462 call WaitFor('term_getline(g:buf, g:lnum) =~ "done"', 3000)
463 call term_wait(buf) 463 call assert_match('done', term_getline(g:buf, g:lnum))
464 bwipe 464
465 endfunc 465 let g:job = term_getjob(g:buf)
466 call Stop_shell_in_terminal(g:buf)
467 call term_wait(g:buf)
468 unlet g:buf
469 unlet g:job
470 unlet g:lnum
471 bwipe
472 endfunc