diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-09-20 02:18:38 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-09-21 08:43:07 -0400 |
commit | ca116625153d806bd192f0f533346cc9536904a9 (patch) | |
tree | 39407b52b39d737d688d4a622d1262846f671faf /src | |
parent | b853b6e4ea1269ab7ae766bd71d9bafd54dc2b98 (diff) | |
download | rneovim-ca116625153d806bd192f0f533346cc9536904a9.tar.gz rneovim-ca116625153d806bd192f0f533346cc9536904a9.tar.bz2 rneovim-ca116625153d806bd192f0f533346cc9536904a9.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/testdir/test_popup.vim | 33 | ||||
-rw-r--r-- | src/nvim/testdir/test_syntax.vim | 3 |
2 files changed, 35 insertions, 1 deletions
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\<CR>") + + " default pumwidth in left window: overlap in right window + call term_sendkeys(buf, "GA\<C-N>") + call VerifyScreenDump(buf, 'Test_popup_position_01', {'rows': 8}) + call term_sendkeys(buf, "\<Esc>u") + + " default pumwidth: fill until right of window + call term_sendkeys(buf, "\<C-W>l") + call term_sendkeys(buf, "GA\<C-N>") + call VerifyScreenDump(buf, 'Test_popup_position_02', {'rows': 8}) + + " larger pumwidth: used as minimum width + call term_sendkeys(buf, "\<Esc>u") + call term_sendkeys(buf, ":set pumwidth=30\<CR>") + call term_sendkeys(buf, "GA\<C-N>") + call VerifyScreenDump(buf, 'Test_popup_position_03', {'rows': 8}) + + call term_sendkeys(buf, "\<Esc>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 = '' |