To: vim_dev@googlegroups.com Subject: Patch 9.0.1222 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.1222 Problem: Terminal tests are flaky on MacOS. Solution: Add TermWait() calls. (Yegappan Lakshmanan, closes #11852) Files: src/testdir/test_terminal2.vim, src/testdir/test_terminal3.vim *** ../vim-9.0.1221/src/testdir/test_terminal2.vim 2022-10-15 20:52:22.563752598 +0100 --- src/testdir/test_terminal2.vim 2023-01-19 17:47:27.553437138 +0000 *************** *** 129,134 **** --- 129,135 ---- let cmd = GetDummyCmd() let rows = winheight(0) let buf = term_start(cmd, #{hidden: 1, term_rows: 10}) + call TermWait(buf) call assert_equal(rows, winheight(0)) call assert_equal([10, &columns], term_getsize(buf)) exe "bwipe! " .. buf *************** *** 196,201 **** --- 197,203 ---- let outfile = 'Xtermstdout' let buf = term_start(['./Xechoerrout.sh'], {'out_io': 'file', 'out_name': outfile}) + call TermWait(buf) call WaitFor({-> !empty(readfile(outfile)) && !empty(term_getline(buf, 1))}) call assert_equal(['this is standard out'], readfile(outfile)) *************** *** 216,221 **** --- 218,224 ---- " will be dropped. exe 'set termwinscroll=' . &lines let buf = term_start('/bin/sh') + call TermWait(buf) for i in range(1, &lines) call feedkeys("echo " . i . "\", 'xt') call WaitForAssert({-> assert_match(string(i), term_getline(buf, term_getcursor(buf)[0] - 1))}) *************** *** 508,513 **** --- 511,517 ---- endif let term = term_start([GetVimProg(), '--clean', '-c', 'set noswapfile', '-c', 'set title']) + call TermWait(term) " When Vim is running as a server then the title ends in VIM{number}, thus " optionally match a number after "VIM". call WaitForAssert({-> assert_match('^\[No Name\] - VIM\d*$', term_gettitle(term)) }) *** ../vim-9.0.1221/src/testdir/test_terminal3.vim 2022-11-10 12:38:13.056131021 +0000 --- src/testdir/test_terminal3.vim 2023-01-19 17:47:27.553437138 +0000 *************** *** 18,23 **** --- 18,24 ---- let cmd = "cat Xtext\" let buf = term_start(&shell, {}) + call TermWait(buf) call writefile(["\[?1047h"], 'Xtext', 'D') call term_sendkeys(buf, cmd) call WaitForAssert({-> assert_equal(1, term_getaltscreen(buf))}) *** ../vim-9.0.1221/src/version.c 2023-01-18 18:17:43.869053455 +0000 --- src/version.c 2023-01-19 17:48:43.541429527 +0000 *************** *** 697,698 **** --- 697,700 ---- { /* Add new patch number below this line */ + /**/ + 1222, /**/ -- This planet has -- or rather had -- a problem, which was this: most of the people living on it were unhappy for pretty much of the time. Many solutions were suggested for this problem, but most of these were largely concerned with the movements of small green pieces of paper, which is odd because on the whole it wasn't the small green pieces of paper that were unhappy. -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///