To: vim_dev@googlegroups.com Subject: Patch 8.2.2877 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2877 Problem: Insufficient tests for popup menu rightleft. Solution: Add tests. (Yegappan Lakshmanan, closes #8235) Files: src/testdir/test_popup.vim, src/testdir/dumps/Test_pum_rightleft_01.dump, src/testdir/dumps/Test_pum_rightleft_02.dump, src/testdir/dumps/Test_pum_scrollbar_01.dump, src/testdir/dumps/Test_pum_scrollbar_02.dump *** ../vim-8.2.2876/src/testdir/test_popup.vim 2021-01-29 21:47:20.485738910 +0100 --- src/testdir/test_popup.vim 2021-05-22 17:09:40.755244152 +0200 *************** *** 1145,1148 **** --- 1145,1217 ---- unlet g:pum_pos endfunc + " Test for the popup menu with the 'rightleft' option set + func Test_pum_rightleft() + CheckScreendump + let lines =<< trim END + abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz + vim + victory + END + call writefile(lines, 'Xtest1') + let buf = RunVimInTerminal('--cmd "set rightleft" Xtest1', {}) + call term_wait(buf) + call term_sendkeys(buf, "Go\") + call term_wait(buf) + call VerifyScreenDump(buf, 'Test_pum_rightleft_01', {'rows': 8}) + call term_sendkeys(buf, "\\") + call term_wait(buf) + redraw! + call assert_match('\s*miv', Screenline(5)) + + " Test for expanding tabs to spaces in the popup menu + let lines =<< trim END + one two + one three + four + END + call writefile(lines, 'Xtest2') + call term_sendkeys(buf, "\:e! Xtest2\") + call term_wait(buf) + call term_sendkeys(buf, "Goone\\") + call term_wait(buf) + redraw! + call VerifyScreenDump(buf, 'Test_pum_rightleft_02', {'rows': 7}) + call term_sendkeys(buf, "\") + call term_wait(buf) + redraw! + call assert_match('\s*eerht eno', Screenline(4)) + + call StopVimInTerminal(buf) + call delete('Xtest1') + call delete('Xtest2') + endfunc + + " Test for a popup menu with a scrollbar + func Test_pum_scrollbar() + CheckScreendump + let lines =<< trim END + one + two + three + END + call writefile(lines, 'Xtest1') + let buf = RunVimInTerminal('--cmd "set pumheight=2" Xtest1', {}) + call term_wait(buf) + call term_sendkeys(buf, "Go\\\") + call term_wait(buf) + call VerifyScreenDump(buf, 'Test_pum_scrollbar_01', {'rows': 7}) + call term_sendkeys(buf, "\\dd") + call term_wait(buf) + + call term_sendkeys(buf, ":set rightleft\") + call term_wait(buf) + call term_sendkeys(buf, "Go\\\") + call term_wait(buf) + call VerifyScreenDump(buf, 'Test_pum_scrollbar_02', {'rows': 7}) + + call StopVimInTerminal(buf) + call delete('Xtest1') + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.2876/src/testdir/dumps/Test_pum_rightleft_01.dump 2021-05-22 17:11:56.694564399 +0200 --- src/testdir/dumps/Test_pum_rightleft_01.dump 2021-05-22 17:09:40.755244152 +0200 *************** *** 0 **** --- 1,8 ---- + |w+0&#ffffff0|v|u|t|s|r|q|p|o|n|m|l|k|j|i|h|g|f|e|d|c|b|a|z|y|x|w|v|u|t|s|r|q|p|o|n|m|l|k|j|i|h|g|f|e|d|c|b|a|z|y|x|w|v|u|t|s|r|q|p|o|n|m|l|k|j|i|h|g|f|e|d|c|b|a + | @45|z|y|x|w|v|u|t|s|r|q|p|o|n|m|l|k|j|i|h|g|f|e|d|c|b|a|z|y|x + | @71|m|i|v + | @67|y|r|o|t|c|i|v + | @66> |y|r|o|t|c|i|v + |w+0#0000001#ffd7ff255|v|u|t|s|r|q|p|o|n|m|l|k|j|i|h|g|f|e|d|c|b|a|z|y|x|w|v|u|t|s|r|q|p|o|n|m|l|k|j|i|h|g|f|e|d|c|b|a|z|y|x|w|v|u|t|s|r|q|p|o|n|m|l|k|j|i|h|g|f|e|d|c|b|a + | @71|m|i|v + | +0&#e0e0e08@67|y|r|o|t|c|i|v *** ../vim-8.2.2876/src/testdir/dumps/Test_pum_rightleft_02.dump 2021-05-22 17:11:56.698564378 +0200 --- src/testdir/dumps/Test_pum_rightleft_02.dump 2021-05-22 17:09:40.755244152 +0200 *************** *** 0 **** --- 1,7 ---- + | +0&#ffffff0@63|o|w|t| @4|e|n|o + | @61|e@1|r|h|t| @4|e|n|o + | @70|r|u|o|f + | @60> |e@1|r|h|t| @4|e|n|o + | +0#4040ff13&@59| +0#0000001#ffd7ff255@6|o|w|t| @1|e|n|o + | +0#4040ff13#ffffff0@59| +0#0000001#e0e0e08@4|e@1|r|h|t| @1|e|n|o + | +0#4040ff13#ffffff0@73|~ *** ../vim-8.2.2876/src/testdir/dumps/Test_pum_scrollbar_01.dump 2021-05-22 17:11:56.702564359 +0200 --- src/testdir/dumps/Test_pum_scrollbar_01.dump 2021-05-22 17:09:40.755244152 +0200 *************** *** 0 **** --- 1,7 ---- + |o+0&#ffffff0|n|e| @71 + |t|w|o| @71 + |t|h|r|e@1| @69 + |o|n|e> @71 + |o+0#0000001#e0e0e08|n|e| @11| +0#0000000#0000001| +0#4040ff13#ffffff0@58 + |t+0#0000001#ffd7ff255|w|o| @11| +0#0000000#a8a8a8255| +0#4040ff13#ffffff0@58 + |~| @73 *** ../vim-8.2.2876/src/testdir/dumps/Test_pum_scrollbar_02.dump 2021-05-22 17:11:56.706564337 +0200 --- src/testdir/dumps/Test_pum_scrollbar_02.dump 2021-05-22 17:09:40.755244152 +0200 *************** *** 0 **** --- 1,7 ---- + | +0&#ffffff0@71|e|n|o + | @71|o|w|t + | @69|e@1|r|h|t + | @70> |e|n|o + | +0#4040ff13&@58| +0#0000000#0000001| +0#0000001#e0e0e08@11|e|n|o + | +0#4040ff13#ffffff0@58| +0#0000000#a8a8a8255| +0#0000001#ffd7ff255@11|o|w|t + | +0#4040ff13#ffffff0@73|~ *** ../vim-8.2.2876/src/version.c 2021-05-21 11:43:54.778873150 +0200 --- src/version.c 2021-05-22 17:11:20.790743842 +0200 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2877, /**/ -- Shit makes the flowers grow and that's beautiful /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///