Mercurial > vim
comparison src/testdir/test_terminal.vim @ 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 | 0927df746554 |
children | 0d1088e3c53f |
comparison
equal
deleted
inserted
replaced
19763:1616cb679e62 | 19764:ed157b5edad0 |
---|---|
673 let len = 5000 | 673 let len = 5000 |
674 endif | 674 endif |
675 | 675 |
676 for c in split('abcdefghijklmnopqrstuvwxyz', '\zs') | 676 for c in split('abcdefghijklmnopqrstuvwxyz', '\zs') |
677 call term_sendkeys(buf, 'echo ' . repeat(c, len) . "\<cr>") | 677 call term_sendkeys(buf, 'echo ' . repeat(c, len) . "\<cr>") |
678 call term_wait(buf, 1) | |
678 endfor | 679 endfor |
679 call term_sendkeys(buf, "echo done\<cr>") | 680 call term_sendkeys(buf, "echo done\<cr>") |
680 | 681 |
681 " On MS-Windows there is an extra empty line below "done". Find "done" in | 682 " On MS-Windows there is an extra empty line below "done". Find "done" in |
682 " the last-but-one or the last-but-two line. | 683 " the last-but-one or the last-but-two line. |
683 let lnum = term_getsize(buf)[0] - 1 | 684 let lnum = term_getsize(buf)[0] - 1 |
684 call WaitFor({-> term_getline(buf, lnum) =~ "done" || term_getline(buf, lnum - 1) =~ "done"}, 10000) | 685 call WaitForAssert({-> assert_match('done', term_getline(buf, lnum - 1) .. '//' .. term_getline(buf, lnum))}) |
685 let line = term_getline(buf, lnum) | 686 let line = term_getline(buf, lnum) |
686 if line !~ 'done' | 687 if line !~ 'done' |
687 let line = term_getline(buf, lnum - 1) | 688 let line = term_getline(buf, lnum - 1) |
688 endif | 689 endif |
689 call assert_match('done', line) | 690 call assert_match('done', line) |