comparison src/testdir/test_terminal.vim @ 19552:d9b365f791d5 v8.2.0333

patch 8.2.0333: terminal in popup test is flaky Commit: https://github.com/vim/vim/commit/57c339569e96725e24e79944bf99f70c50afb5b1 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 29 16:09:16 2020 +0100 patch 8.2.0333: terminal in popup test is flaky Problem: Terminal in popup test is flaky. Solution: Make sure redraw is done before opening the popup.
author Bram Moolenaar <Bram@vim.org>
date Sat, 29 Feb 2020 16:15:04 +0100
parents 9e428147e4ee
children 47db1e17d0a4
comparison
equal deleted inserted replaced
19551:769a53c270ee 19552:d9b365f791d5
2337 \ 'set t_u7=', 2337 \ 'set t_u7=',
2338 \ 'call setline(1, range(20))', 2338 \ 'call setline(1, range(20))',
2339 \ 'hi PopTerm ctermbg=grey', 2339 \ 'hi PopTerm ctermbg=grey',
2340 \ 'func OpenTerm(setColor)', 2340 \ 'func OpenTerm(setColor)',
2341 \ " let s:buf = term_start('" .. cmd .. " Xtext', #{hidden: 1, term_finish: 'close'})", 2341 \ " let s:buf = term_start('" .. cmd .. " Xtext', #{hidden: 1, term_finish: 'close'})",
2342 \ ' let s:winid = popup_create(s:buf, #{minwidth: 45, minheight: 7, border: [], drag: 1, resize: 1})', 2342 \ ' let g:winid = popup_create(s:buf, #{minwidth: 45, minheight: 7, border: [], drag: 1, resize: 1})',
2343 \ ' if a:setColor', 2343 \ ' if a:setColor',
2344 \ ' call win_execute(s:winid, "set wincolor=PopTerm")', 2344 \ ' call win_execute(g:winid, "set wincolor=PopTerm")',
2345 \ ' endif', 2345 \ ' endif',
2346 \ 'endfunc', 2346 \ 'endfunc',
2347 \ 'call OpenTerm(0)',
2348 \ 'func HidePopup()', 2347 \ 'func HidePopup()',
2349 \ ' call popup_hide(s:winid)', 2348 \ ' call popup_hide(g:winid)',
2350 \ 'endfunc', 2349 \ 'endfunc',
2351 \ 'func ClosePopup()', 2350 \ 'func ClosePopup()',
2352 \ ' call popup_close(s:winid)', 2351 \ ' call popup_close(g:winid)',
2353 \ 'endfunc', 2352 \ 'endfunc',
2354 \ 'func ReopenPopup()', 2353 \ 'func ReopenPopup()',
2355 \ ' call popup_create(s:buf, #{minwidth: 40, minheight: 6, border: []})', 2354 \ ' call popup_create(s:buf, #{minwidth: 40, minheight: 6, border: []})',
2356 \ 'endfunc', 2355 \ 'endfunc',
2357 \ 'sleep 10m',
2358 \ 'redraw',
2359 \ 'echo getwinvar(s:winid, "&buftype") win_gettype(s:winid)',
2360 \ ] 2356 \ ]
2361 call writefile(lines, 'XtermPopup') 2357 call writefile(lines, 'XtermPopup')
2362 let buf = RunVimInTerminal('-S XtermPopup', #{rows: 15}) 2358 let buf = RunVimInTerminal('-S XtermPopup', #{rows: 15})
2363 call term_wait(buf, 100) 2359 call term_wait(buf, 100)
2360 call term_sendkeys(buf, ":call OpenTerm(0)\<CR>")
2361 call term_wait(buf, 100)
2364 call term_sendkeys(buf, ":\<CR>") 2362 call term_sendkeys(buf, ":\<CR>")
2363 call term_sendkeys(buf, "\<C-W>:echo getwinvar(g:winid, \"&buftype\") win_gettype(g:winid)\<CR>")
2365 call VerifyScreenDump(buf, 'Test_terminal_popup_1', {}) 2364 call VerifyScreenDump(buf, 'Test_terminal_popup_1', {})
2366 2365
2367 call term_sendkeys(buf, ":q\<CR>") 2366 call term_sendkeys(buf, ":q\<CR>")
2368 call VerifyScreenDump(buf, 'Test_terminal_popup_2', {}) 2367 call VerifyScreenDump(buf, 'Test_terminal_popup_2', {})
2369 2368