From ca116625153d806bd192f0f533346cc9536904a9 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 20 Sep 2019 02:18:38 -0400 Subject: vim-patch:8.0.1539: no test for the popup menu positioning Problem: No test for the popup menu positioning. Solution: Add a screendump test for the popup menu. https://github.com/vim/vim/commit/6bb2cdfe604e51eec216cbe23bb6e8fb47810347 --- src/nvim/testdir/test_popup.vim | 33 +++++++++++++++++++++++++++++++++ src/nvim/testdir/test_syntax.vim | 3 ++- 2 files changed, 35 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/testdir/test_popup.vim b/src/nvim/testdir/test_popup.vim index 53df30bb19..efef91789d 100644 --- a/src/nvim/testdir/test_popup.vim +++ b/src/nvim/testdir/test_popup.vim @@ -1,6 +1,7 @@ " Test for completion menu source shared.vim +source screendump.vim let g:months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] let g:setting = '' @@ -735,6 +736,38 @@ func Test_popup_and_preview_autocommand() bw! endfunc +func Test_popup_position() + if !CanRunVimInTerminal() + return + endif + call writefile([ + \ '123456789_123456789_123456789_a', + \ '123456789_123456789_123456789_b', + \ ' 123', + \ ], 'Xtest') + let buf = RunVimInTerminal('Xtest', {}) + call term_sendkeys(buf, ":vsplit\") + + " default pumwidth in left window: overlap in right window + call term_sendkeys(buf, "GA\") + call VerifyScreenDump(buf, 'Test_popup_position_01', {'rows': 8}) + call term_sendkeys(buf, "\u") + + " default pumwidth: fill until right of window + call term_sendkeys(buf, "\l") + call term_sendkeys(buf, "GA\") + call VerifyScreenDump(buf, 'Test_popup_position_02', {'rows': 8}) + + " larger pumwidth: used as minimum width + call term_sendkeys(buf, "\u") + call term_sendkeys(buf, ":set pumwidth=30\") + call term_sendkeys(buf, "GA\") + call VerifyScreenDump(buf, 'Test_popup_position_03', {'rows': 8}) + + call term_sendkeys(buf, "\u") + call StopVimInTerminal(buf) + call delete('Xtest') +endfunc func Test_popup_complete_backwards() new diff --git a/src/nvim/testdir/test_syntax.vim b/src/nvim/testdir/test_syntax.vim index 598a00476c..b9310e2168 100644 --- a/src/nvim/testdir/test_syntax.vim +++ b/src/nvim/testdir/test_syntax.vim @@ -1,6 +1,7 @@ " Test for syntax and syntax iskeyword option source view_util.vim +source screendump.vim func GetSyntaxItem(pat) let c = '' @@ -526,7 +527,7 @@ func Test_syntax_c() let $COLORFGBG = '15;0' let buf = RunVimInTerminal('Xtest.c', {}) - call VerifyScreenDump(buf, 'Test_syntax_c_01') + call VerifyScreenDump(buf, 'Test_syntax_c_01', {}) call StopVimInTerminal(buf) let $COLORFGBG = '' -- cgit