Mercurial > vim
changeset 19764:ed157b5edad0 v8.2.0438
patch 8.2.0438: terminal noblock test is very flaky on BSD
Commit: https://github.com/vim/vim/commit/d7b7770f11c16cfac707b5048c61e722dcc903a6
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Mar 23 22:46:44 2020 +0100
patch 8.2.0438: terminal noblock test is very flaky on BSD
Problem: Terminal noblock test is very flaky on BSD.
Solution: Change WaitFor() to WaitForAssert() to be able to see why it
failed. Add a short wait in between sending keys.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 23 Mar 2020 23:00:04 +0100 |
parents | 1616cb679e62 |
children | 24bdcdb27edd |
files | src/testdir/test_terminal.vim src/version.c |
diffstat | 2 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/testdir/test_terminal.vim +++ b/src/testdir/test_terminal.vim @@ -675,13 +675,14 @@ func Test_terminal_noblock() for c in split('abcdefghijklmnopqrstuvwxyz', '\zs') call term_sendkeys(buf, 'echo ' . repeat(c, len) . "\<cr>") + call term_wait(buf, 1) endfor call term_sendkeys(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 lnum = term_getsize(buf)[0] - 1 - call WaitFor({-> term_getline(buf, lnum) =~ "done" || term_getline(buf, lnum - 1) =~ "done"}, 10000) + call WaitForAssert({-> assert_match('done', term_getline(buf, lnum - 1) .. '//' .. term_getline(buf, lnum))}) let line = term_getline(buf, lnum) if line !~ 'done' let line = term_getline(buf, lnum - 1)