aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <janedmundlazo@hotmail.com>2018-11-19 23:45:59 -0500
committerJan Edmund Lazo <janedmundlazo@hotmail.com>2018-11-19 23:46:17 -0500
commit3c228e8935ab39f9c63f9e32152cb3d2b4bce543 (patch)
tree38917788ceaf619d4970ea455b9fddc2d3e8536a
parentf1d2297c5ece3463ae098b9cd779e067cbf653fa (diff)
downloadrneovim-3c228e8935ab39f9c63f9e32152cb3d2b4bce543.tar.gz
rneovim-3c228e8935ab39f9c63f9e32152cb3d2b4bce543.tar.bz2
rneovim-3c228e8935ab39f9c63f9e32152cb3d2b4bce543.zip
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
-rw-r--r--src/nvim/testdir/test_popup.vim6
1 files changed, 6 insertions, 0 deletions
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\<esc>G")
+ call term_wait(g:buf, 100)
call term_sendkeys(g:buf, "i\<c-x>")
call term_wait(g:buf, 100)
call term_sendkeys(g:buf, "\<c-v>")
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