From 0f52e2c849cbd923fc30b8bbef088b6f7642aeab Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 21 Jan 2023 20:50:46 +0800 Subject: vim-patch:8.2.0382: some tests fail when run under valgrind (#21936) Problem: Some tests fail when run under valgrind. Solution: Increase timeouts. https://github.com/vim/vim/commit/353c351bd22e4dac4c3ae9cd7731032348f248c4 Cherry-pick Test_pum_with_preview_win() from patch 8.2.0011. Co-authored-by: Bram Moolenaar --- test/functional/ui/popupmenu_spec.lua | 61 +++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) (limited to 'test/functional') diff --git a/test/functional/ui/popupmenu_spec.lua b/test/functional/ui/popupmenu_spec.lua index 1f139aa7fb..c681453294 100644 --- a/test/functional/ui/popupmenu_spec.lua +++ b/test/functional/ui/popupmenu_spec.lua @@ -1044,6 +1044,7 @@ describe('builtin popupmenu', function() [5] = {bold = true, foreground = Screen.colors.SeaGreen}, [6] = {foreground = Screen.colors.Grey100, background = Screen.colors.Red}, [7] = {background = Screen.colors.Yellow}, -- Search + [8] = {foreground = Screen.colors.Red}, }) end) @@ -1191,6 +1192,66 @@ describe('builtin popupmenu', function() ]]) 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') + 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('') + 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() insert('aaa aab aac\n') feed(':vsplit') -- cgit