mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
vim-patch:8.2.0382: some tests fail when run under valgrind (#21936)
Problem: Some tests fail when run under valgrind.
Solution: Increase timeouts.
353c351bd2
Cherry-pick Test_pum_with_preview_win() from patch 8.2.0011.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -824,7 +824,7 @@ static bool pum_set_selected(int n, int repeat)
|
|||||||
// When the preview window was resized we need to
|
// When the preview window was resized we need to
|
||||||
// update the view on the buffer. Only go back to
|
// update the view on the buffer. Only go back to
|
||||||
// the window when needed, otherwise it will always be
|
// the window when needed, otherwise it will always be
|
||||||
// redraw.
|
// redrawn.
|
||||||
if (resized) {
|
if (resized) {
|
||||||
no_u_sync++;
|
no_u_sync++;
|
||||||
win_enter(curwin_save, true);
|
win_enter(curwin_save, true);
|
||||||
|
@@ -2919,7 +2919,7 @@ func Test_autocmd_CmdWinEnter()
|
|||||||
call term_sendkeys(buf, "q:")
|
call term_sendkeys(buf, "q:")
|
||||||
call term_wait(buf)
|
call term_wait(buf)
|
||||||
call term_sendkeys(buf, ":echo b:dummy_var\<cr>")
|
call term_sendkeys(buf, ":echo b:dummy_var\<cr>")
|
||||||
call WaitForAssert({-> assert_match('^This is a dummy', term_getline(buf, 6))}, 1000)
|
call WaitForAssert({-> assert_match('^This is a dummy', term_getline(buf, 6))}, 2000)
|
||||||
call term_sendkeys(buf, ":echo &buftype\<cr>")
|
call term_sendkeys(buf, ":echo &buftype\<cr>")
|
||||||
call WaitForAssert({-> assert_notmatch('^nofile', term_getline(buf, 6))}, 1000)
|
call WaitForAssert({-> assert_notmatch('^nofile', term_getline(buf, 6))}, 1000)
|
||||||
call term_sendkeys(buf, ":echo winnr\<cr>")
|
call term_sendkeys(buf, ":echo winnr\<cr>")
|
||||||
|
@@ -36,7 +36,7 @@ endfunc
|
|||||||
" If the expected output argument is supplied, then check for it.
|
" If the expected output argument is supplied, then check for it.
|
||||||
func RunDbgCmd(buf, cmd, ...)
|
func RunDbgCmd(buf, cmd, ...)
|
||||||
call term_sendkeys(a:buf, a:cmd . "\r")
|
call term_sendkeys(a:buf, a:cmd . "\r")
|
||||||
call term_wait(a:buf)
|
call term_wait(a:buf, 20)
|
||||||
|
|
||||||
if a:0 != 0
|
if a:0 != 0
|
||||||
let options = #{match: 'equal'}
|
let options = #{match: 'equal'}
|
||||||
|
@@ -581,6 +581,33 @@ func Test_pum_with_folds_two_tabs()
|
|||||||
call delete('Xpumscript')
|
call delete('Xpumscript')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_pum_with_preview_win()
|
||||||
|
CheckScreendump
|
||||||
|
|
||||||
|
let lines =<< trim END
|
||||||
|
funct Omni_test(findstart, base)
|
||||||
|
if a:findstart
|
||||||
|
return col(".") - 1
|
||||||
|
endif
|
||||||
|
return [#{word: "one", info: "1info"}, #{word: "two", info: "2info"}, #{word: "three", info: "3info"}]
|
||||||
|
endfunc
|
||||||
|
set omnifunc=Omni_test
|
||||||
|
set completeopt+=longest
|
||||||
|
END
|
||||||
|
|
||||||
|
call writefile(lines, 'Xpreviewscript')
|
||||||
|
let buf = RunVimInTerminal('-S Xpreviewscript', #{rows: 12})
|
||||||
|
call term_wait(buf, 100)
|
||||||
|
call term_sendkeys(buf, "Gi\<C-X>\<C-O>")
|
||||||
|
call term_wait(buf, 200)
|
||||||
|
call term_sendkeys(buf, "\<C-N>")
|
||||||
|
call VerifyScreenDump(buf, 'Test_pum_with_preview_win', {})
|
||||||
|
|
||||||
|
call term_sendkeys(buf, "\<Esc>")
|
||||||
|
call StopVimInTerminal(buf)
|
||||||
|
call delete('Xpreviewscript')
|
||||||
|
endfunc
|
||||||
|
|
||||||
" Test for inserting the tag search pattern in insert mode
|
" Test for inserting the tag search pattern in insert mode
|
||||||
func Test_ins_compl_tag_sft()
|
func Test_ins_compl_tag_sft()
|
||||||
call writefile([
|
call writefile([
|
||||||
|
@@ -1044,6 +1044,7 @@ describe('builtin popupmenu', function()
|
|||||||
[5] = {bold = true, foreground = Screen.colors.SeaGreen},
|
[5] = {bold = true, foreground = Screen.colors.SeaGreen},
|
||||||
[6] = {foreground = Screen.colors.Grey100, background = Screen.colors.Red},
|
[6] = {foreground = Screen.colors.Grey100, background = Screen.colors.Red},
|
||||||
[7] = {background = Screen.colors.Yellow}, -- Search
|
[7] = {background = Screen.colors.Yellow}, -- Search
|
||||||
|
[8] = {foreground = Screen.colors.Red},
|
||||||
})
|
})
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@@ -1191,6 +1192,66 @@ describe('builtin popupmenu', function()
|
|||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
-- oldtest: Test_pum_with_preview_win()
|
||||||
|
it('preview window opened during completion', function()
|
||||||
|
exec([[
|
||||||
|
funct Omni_test(findstart, base)
|
||||||
|
if a:findstart
|
||||||
|
return col(".") - 1
|
||||||
|
endif
|
||||||
|
return [#{word: "one", info: "1info"}, #{word: "two", info: "2info"}, #{word: "three", info: "3info"}]
|
||||||
|
endfunc
|
||||||
|
set omnifunc=Omni_test
|
||||||
|
set completeopt+=longest
|
||||||
|
]])
|
||||||
|
feed('Gi<C-X><C-O>')
|
||||||
|
screen:expect([[
|
||||||
|
^ |
|
||||||
|
{n:one }{1: }|
|
||||||
|
{n:two }{1: }|
|
||||||
|
{n:three }{1: }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{2:-- }{8:Back at original} |
|
||||||
|
]])
|
||||||
|
feed('<C-N>')
|
||||||
|
screen:expect([[
|
||||||
|
1info |
|
||||||
|
|
|
||||||
|
{1:~ }|
|
||||||
|
{3:[Scratch] [Preview] }|
|
||||||
|
one^ |
|
||||||
|
{s:one }{1: }|
|
||||||
|
{n:two }{1: }|
|
||||||
|
{n:three }{1: }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{4:[No Name] [+] }|
|
||||||
|
{2:-- }{5:match 1 of 3} |
|
||||||
|
]])
|
||||||
|
end)
|
||||||
|
|
||||||
it('with vsplits', function()
|
it('with vsplits', function()
|
||||||
insert('aaa aab aac\n')
|
insert('aaa aab aac\n')
|
||||||
feed(':vsplit<cr>')
|
feed(':vsplit<cr>')
|
||||||
|
Reference in New Issue
Block a user