0
0
mirror of https://github.com/vim/vim.git synced 2025-09-28 04:24:06 -04:00

patch 8.2.0811: terminal keycode test is flaky

Problem:    Terminal keycode test is flaky.
Solution:   Use WaitForAssert()
This commit is contained in:
Bram Moolenaar
2020-05-22 14:44:26 +02:00
parent 2e61e2d083
commit 9cdcd1d0dc
2 changed files with 7 additions and 7 deletions

View File

@@ -2493,6 +2493,7 @@ func Test_terminal_in_popup()
call term_sendkeys(buf, ":call OpenTerm(1)\<CR>") call term_sendkeys(buf, ":call OpenTerm(1)\<CR>")
call TermWait(buf, 150) call TermWait(buf, 150)
call term_sendkeys(buf, ":set hlsearch\<CR>") call term_sendkeys(buf, ":set hlsearch\<CR>")
call TermWait(buf, 100)
call term_sendkeys(buf, "/edit\<CR>") call term_sendkeys(buf, "/edit\<CR>")
call VerifyScreenDump(buf, 'Test_terminal_popup_3', {}) call VerifyScreenDump(buf, 'Test_terminal_popup_3', {})
@@ -2517,7 +2518,7 @@ func Test_terminal_in_popup()
call TermWait(buf, 50) call TermWait(buf, 50)
call term_sendkeys(buf, ":q\<CR>") call term_sendkeys(buf, ":q\<CR>")
call TermWait(buf, 100) " wait for terminal to vanish call TermWait(buf, 150) " wait for terminal to vanish
call StopVimInTerminal(buf) call StopVimInTerminal(buf)
call delete('Xtext') call delete('Xtext')
@@ -2704,8 +2705,7 @@ func Test_term_keycode_translation()
call term_sendkeys(buf, "i") call term_sendkeys(buf, "i")
for i in range(len(keys)) for i in range(len(keys))
call term_sendkeys(buf, "\<C-U>\<C-K>" .. keys[i]) call term_sendkeys(buf, "\<C-U>\<C-K>" .. keys[i])
call term_wait(buf) call WaitForAssert({-> assert_equal(output[i], term_getline(buf, 1))})
call assert_equal(output[i], term_getline(buf, 1))
endfor endfor
let keypad_keys = ["\<k0>", "\<k1>", "\<k2>", "\<k3>", "\<k4>", "\<k5>", let keypad_keys = ["\<k0>", "\<k1>", "\<k2>", "\<k3>", "\<k4>", "\<k5>",
@@ -2720,13 +2720,11 @@ func Test_term_keycode_translation()
continue continue
endif endif
call term_sendkeys(buf, "\<C-U>" .. keypad_keys[i]) call term_sendkeys(buf, "\<C-U>" .. keypad_keys[i])
call term_wait(buf) call WaitForAssert({-> assert_equal(keypad_output[i], term_getline(buf, 1))})
call assert_equal(keypad_output[i], term_getline(buf, 1))
endfor endfor
call feedkeys("\<C-U>\<kEnter>\<BS>one\<C-W>.two", 'xt') call feedkeys("\<C-U>\<kEnter>\<BS>one\<C-W>.two", 'xt')
call term_wait(buf) call WaitForAssert({-> assert_equal('two', term_getline(buf, 1))})
call assert_equal('two', term_getline(buf, 1))
call StopVimInTerminal(buf) call StopVimInTerminal(buf)
endfunc endfunc

View File

@@ -746,6 +746,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
811,
/**/ /**/
810, 810,
/**/ /**/