]> granicus.if.org Git - vim/commitdiff
patch 8.2.0333: terminal in popup test is flaky v8.2.0333
authorBram Moolenaar <Bram@vim.org>
Sat, 29 Feb 2020 15:09:16 +0000 (16:09 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 29 Feb 2020 15:09:16 +0000 (16:09 +0100)
Problem:    Terminal in popup test is flaky.
Solution:   Make sure redraw is done before opening the popup.

src/testdir/dumps/Test_terminal_popup_1.dump
src/testdir/test_terminal.vim
src/version.c

index a03d5898114a29c27e7b8331c6cd4f4bd4cbe27d..3e071498df1fb38cef3b2c88caff83db0a54ada7 100644 (file)
@@ -12,4 +12,4 @@
 |1@1| @11|╚+0#0000001#ffd7ff255|═@44|⇲| +0#0000000#ffffff0@13
 |1|2| @72
 |1|3| @72
-|t|e|r|m|i|n|a|l| |p|o|p|u|p| @42|0|,|0|-|1| @8|A|l@1
+|t|e|r|m|i|n|a|l| |p|o|p|u|p| @42|1|,|1| @10|T|o|p
index e2d7595460fca118a49546efd4ce6b8eba6de749..1a9e1e3d4a66760cdc6654a9c8a5fc4bfbddc65e 100644 (file)
@@ -2339,29 +2339,28 @@ func Test_terminal_in_popup()
        \ 'hi PopTerm ctermbg=grey',
        \ 'func OpenTerm(setColor)',
        \ "  let s:buf = term_start('" .. cmd .. " Xtext', #{hidden: 1, term_finish: 'close'})",
-       \ '  let s:winid = popup_create(s:buf, #{minwidth: 45, minheight: 7, border: [], drag: 1, resize: 1})',
+       \ '  let g:winid = popup_create(s:buf, #{minwidth: 45, minheight: 7, border: [], drag: 1, resize: 1})',
        \ '  if a:setColor',
-       \ '    call win_execute(s:winid, "set wincolor=PopTerm")',
+       \ '    call win_execute(g:winid, "set wincolor=PopTerm")',
        \ '  endif',
        \ 'endfunc',
-       \ 'call OpenTerm(0)',
        \ 'func HidePopup()',
-       \ '  call popup_hide(s:winid)',
+       \ '  call popup_hide(g:winid)',
        \ 'endfunc',
        \ 'func ClosePopup()',
-       \ '  call popup_close(s:winid)',
+       \ '  call popup_close(g:winid)',
        \ 'endfunc',
        \ 'func ReopenPopup()',
        \ '  call popup_create(s:buf, #{minwidth: 40, minheight: 6, border: []})',
        \ 'endfunc',
-       \ 'sleep 10m',
-       \ 'redraw',
-       \ 'echo getwinvar(s:winid, "&buftype") win_gettype(s:winid)',
        \ ]
   call writefile(lines, 'XtermPopup')
   let buf = RunVimInTerminal('-S XtermPopup', #{rows: 15})
   call term_wait(buf, 100)
+  call term_sendkeys(buf, ":call OpenTerm(0)\<CR>")
+  call term_wait(buf, 100)
   call term_sendkeys(buf, ":\<CR>")
+  call term_sendkeys(buf, "\<C-W>:echo getwinvar(g:winid, \"&buftype\") win_gettype(g:winid)\<CR>")
   call VerifyScreenDump(buf, 'Test_terminal_popup_1', {})
 
   call term_sendkeys(buf, ":q\<CR>")
index 42b859aba36be76d459afd7b8a82f36d2ba7f763..a8289633bf7c5903d4a982a9a3bba3bb465f8755 100644 (file)
@@ -738,6 +738,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    333,
 /**/
     332,
 /**/