vim-patch:9.0.1449: test for prompt buffer is flaky (#23076)

Problem:    Test for prompt buffer is flaky.
Solution:   Use WaitForAssert() instead of TermWait(). (Ozaki Kiichi,
            closes vim/vim#12247)

ff6c230051
This commit is contained in:
zeertzjq 2023-04-14 07:12:42 +08:00 committed by GitHub
parent 8f69c5ed45
commit f64f6706e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -283,20 +283,16 @@ func Test_prompt_appending_while_hidden()
call TermWait(buf) call TermWait(buf)
call term_sendkeys(buf, "exit\<CR>") call term_sendkeys(buf, "exit\<CR>")
call TermWait(buf) call WaitForAssert({-> assert_notmatch('-- INSERT --', term_getline(buf, 10))})
call assert_notmatch('-- INSERT --', term_getline(buf, 10))
call term_sendkeys(buf, ":call DoAppend()\<CR>") call term_sendkeys(buf, ":call DoAppend()\<CR>")
call TermWait(buf) call WaitForAssert({-> assert_notmatch('-- INSERT --', term_getline(buf, 10))})
call assert_notmatch('-- INSERT --', term_getline(buf, 10))
call term_sendkeys(buf, "i") call term_sendkeys(buf, "i")
call TermWait(buf) call WaitForAssert({-> assert_match('-- INSERT --', term_getline(buf, 10))})
call assert_match('-- INSERT --', term_getline(buf, 10))
call term_sendkeys(buf, "\<C-R>=DoAppend()\<CR>") call term_sendkeys(buf, "\<C-R>=DoAppend()\<CR>")
call TermWait(buf) call WaitForAssert({-> assert_match('-- INSERT --', term_getline(buf, 10))})
call assert_match('-- INSERT --', term_getline(buf, 10))
call term_sendkeys(buf, "\<Esc>") call term_sendkeys(buf, "\<Esc>")
call StopVimInTerminal(buf) call StopVimInTerminal(buf)