]> granicus.if.org Git - vim/commitdiff
patch 8.0.1165: popup test is still flaky v8.0.1165
authorBram Moolenaar <Bram@vim.org>
Sat, 30 Sep 2017 14:49:19 +0000 (16:49 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 30 Sep 2017 14:49:19 +0000 (16:49 +0200)
Problem:    Popup test is still flaky.
Solution:   Add a term_wait() call. (Ozaki Kiichi)

src/testdir/test_popup.vim
src/version.c

index 4ab860b81338b2f4ef927613bf8714903f56dbd7..0dfa956fb28c60d5245575cb99317f93f820935c 100644 (file)
@@ -645,20 +645,26 @@ func Test_popup_and_window_resize()
   endif
   let g:buf = term_start([$VIMPROG, '--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
 
index c055dd43794d61a7799636e5519cbc6a0a367905..b28cd91a6db61bee0089d437310337373b0ee4fd 100644 (file)
@@ -761,6 +761,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1165,
 /**/
     1164,
 /**/