diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-03-30 21:59:55 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-03-31 10:05:26 +0800 |
commit | 86f81c471a2acd87854eb11e20ddbebe244ff7c0 (patch) | |
tree | 59353590388eb270a83721739cf626378ef8ef98 | |
parent | 5a3a1304e1e8b1fe8a2f8d0ccd70390881777bfe (diff) | |
download | rneovim-86f81c471a2acd87854eb11e20ddbebe244ff7c0.tar.gz rneovim-86f81c471a2acd87854eb11e20ddbebe244ff7c0.tar.bz2 rneovim-86f81c471a2acd87854eb11e20ddbebe244ff7c0.zip |
vim-patch:8.2.4577: message test is flaky
Problem: Message test is flaky. (Elimar Riesebieter)
Solution: Trigger the autocommand event only after startup is finished.
https://github.com/vim/vim/commit/9323ca51c2b1522f26907a7b8879067245ebd1be
-rw-r--r-- | src/nvim/testdir/test_messages.vim | 5 | ||||
-rw-r--r-- | test/functional/legacy/messages_spec.lua | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/nvim/testdir/test_messages.vim b/src/nvim/testdir/test_messages.vim index 7c6af32e82..82c4cc128b 100644 --- a/src/nvim/testdir/test_messages.vim +++ b/src/nvim/testdir/test_messages.vim @@ -151,12 +151,13 @@ func Test_fileinfo_after_echo() hide buffer a.txt - set updatetime=1 - autocmd CursorHold * b b.txt | w | echo "'b' written" + autocmd CursorHold * buf b.txt | w | echo "'b' written" END call writefile(content, 'Xtest_fileinfo_after_echo') let buf = RunVimInTerminal('-S Xtest_fileinfo_after_echo', #{rows: 6}) + call term_sendkeys(buf, ":set updatetime=50\<CR>") + call term_sendkeys(buf, "0$") call VerifyScreenDump(buf, 'Test_fileinfo_after_echo', {}) call term_sendkeys(buf, ":q\<CR>") diff --git a/test/functional/legacy/messages_spec.lua b/test/functional/legacy/messages_spec.lua index 0f81ad5296..34807a099c 100644 --- a/test/functional/legacy/messages_spec.lua +++ b/test/functional/legacy/messages_spec.lua @@ -54,9 +54,10 @@ describe('messages', function() hide buffer a.txt - set updatetime=1 - autocmd CursorHold * b b.txt | w | echo "'b' written" + autocmd CursorHold * buf b.txt | w | echo "'b' written" ]]) + command('set updatetime=50') + feed('0$') screen:expect([[ ^hi | {1:~ }| |