To: vim_dev@googlegroups.com Subject: Patch 8.0.0940 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.0940 Problem: Test_terminal_scrape_multibyte is flaky. (James McCoy) Solution: Use WaitFor() instead of term_wait(). Files: src/testdir/test_terminal.vim *** ../vim-8.0.0939/src/testdir/test_terminal.vim 2017-08-14 21:44:56.050922676 +0200 --- src/testdir/test_terminal.vim 2017-08-14 21:58:43.849748379 +0200 *************** *** 189,203 **** else let cmd = "cat Xtext" endif ! let buf = term_start(cmd) ! ! call term_wait(buf) ! if has('win32') ! " TODO: this should not be needed ! sleep 100m ! endif ! let l = term_scrape(buf, 1) call assert_true(len(l) >= 7) call assert_equal('l', l[0].chars) call assert_equal('é', l[1].chars) --- 189,198 ---- else let cmd = "cat Xtext" endif ! let g:buf = term_start(cmd) ! call WaitFor('term_scrape(g:buf, 1)[0].chars == "l"') ! let l = term_scrape(g:buf, 1) call assert_true(len(l) >= 7) call assert_equal('l', l[0].chars) call assert_equal('é', l[1].chars) *************** *** 209,219 **** call assert_equal('r', l[5].chars) call assert_equal('s', l[6].chars) ! let g:job = term_getjob(buf) call WaitFor('job_status(g:job) == "dead"') ! call term_wait(buf) ! exe buf . 'bwipe' call delete('Xtext') endfunc --- 204,215 ---- call assert_equal('r', l[5].chars) call assert_equal('s', l[6].chars) ! let g:job = term_getjob(g:buf) call WaitFor('job_status(g:job) == "dead"') ! call term_wait(g:buf) ! exe g:buf . 'bwipe' ! unlet g:buf call delete('Xtext') endfunc *************** *** 409,424 **** if !has('unix') return endif ! let buf = Run_shell_in_terminal({'env': {'TESTENV': 'correct'}}) " Wait for the shell to display a prompt ! call WaitFor('term_getline(1) != ""') ! call term_sendkeys(buf, "echo $TESTENV\r") ! call term_wait(buf) ! call Stop_shell_in_terminal(buf) call WaitFor('getline(2) == "correct"') call assert_equal('correct', getline(2)) ! exe buf . 'bwipe' endfunc " must be last, we can't go back from GUI to terminal --- 405,421 ---- if !has('unix') return endif ! let g:buf = Run_shell_in_terminal({'env': {'TESTENV': 'correct'}}) " Wait for the shell to display a prompt ! call WaitFor('term_getline(g:buf, 1) != ""') ! call term_sendkeys(g:buf, "echo $TESTENV\r") ! call term_wait(g:buf) ! call Stop_shell_in_terminal(g:buf) call WaitFor('getline(2) == "correct"') call assert_equal('correct', getline(2)) ! exe g:buf . 'bwipe' ! unlet g:buf endfunc " must be last, we can't go back from GUI to terminal *** ../vim-8.0.0939/src/version.c 2017-08-14 21:44:56.054922651 +0200 --- src/version.c 2017-08-14 22:00:44.005006149 +0200 *************** *** 771,772 **** --- 771,774 ---- { /* Add new patch number below this line */ + /**/ + 940, /**/ -- Did Adam and Eve have navels? /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///