From 3c228e8935ab39f9c63f9e32152cb3d2b4bce543 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Mon, 19 Nov 2018 23:45:59 -0500 Subject: vim-patch:8.0.1165: popup test is still flaky Problem: Popup test is still flaky. Solution: Add a term_wait() call. (Ozaki Kiichi) https://github.com/vim/vim/commit/f52c38315669f85bbcf3bd74c590148bf588f6c6 --- src/nvim/testdir/test_popup.vim | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/nvim/testdir/test_popup.vim b/src/nvim/testdir/test_popup.vim index 9cd591838c..b8f7ac0459 100644 --- a/src/nvim/testdir/test_popup.vim +++ b/src/nvim/testdir/test_popup.vim @@ -677,20 +677,26 @@ func Test_popup_and_window_resize() endif let g:buf = term_start([$NVIM_PRG, '--clean', '-c', 'set noswapfile'], {'term_rows': h / 3}) call term_sendkeys(g:buf, (h / 3 - 1)."o\G") + call term_wait(g:buf, 100) call term_sendkeys(g:buf, "i\") call term_wait(g:buf, 100) call term_sendkeys(g:buf, "\") call term_wait(g:buf, 100) + " popup first entry "!" must be at the top call WaitFor('term_getline(g:buf, 1) =~ "^!"') call assert_match('^!\s*$', term_getline(g:buf, 1)) exe 'resize +' . (h - 1) call term_wait(g:buf, 100) redraw! + " popup shifted down, first line is now empty call WaitFor('term_getline(g:buf, 1) == ""') call assert_equal('', term_getline(g:buf, 1)) sleep 100m + " popup is below cursor line and shows first match "!" call WaitFor('term_getline(g:buf, term_getcursor(g:buf)[0] + 1) =~ "^!"') call assert_match('^!\s*$', term_getline(g:buf, term_getcursor(g:buf)[0] + 1)) + " cursor line also shows ! + call assert_match('^!\s*$', term_getline(g:buf, term_getcursor(g:buf)[0])) bwipe! endfunc -- cgit