To: vim_dev@googlegroups.com Subject: Patch 8.2.0342 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0342 Problem: Some code in ex_getln.c not covered by tests. Solution: Add more tests. (Yegappan Lakshmanan, closes #5717) Files: src/testdir/test_cmdline.vim, src/testdir/test_ex_mode.vim, src/testdir/test_history.vim, src/testdir/test_iminsert.vim *** ../vim-8.2.0341/src/testdir/test_cmdline.vim 2020-02-29 22:06:25.647709244 +0100 --- src/testdir/test_cmdline.vim 2020-03-01 16:49:39.419245507 +0100 *************** *** 1188,1193 **** --- 1188,1194 ---- func Test_cmdline_edit() let str = ":one two\" let str ..= "one two\\" + let str ..= "one\\\" let str ..= "\five\" let str ..= "\two " let str ..= "\one " *************** *** 1206,1211 **** --- 1207,1213 ---- set rightleftcmd=search let str = "/one two\" let str ..= "one two\\" + let str ..= "one\\\" let str ..= "\five\" let str ..= "\two " let str ..= "\one " *************** *** 1233,1236 **** --- 1235,1271 ---- call assert_equal("\"e \\", @:) endfunc + " Test for 'imcmdline' and 'imsearch' + " This test doesn't actually test the input method functionality. + func Test_cmdline_inputmethod() + new + call setline(1, ['', 'abc', '']) + set imcmdline + + call feedkeys(":\"abc\", 'xt') + call assert_equal("\"abc", @:) + call feedkeys(":\"\abc\\", 'xt') + call assert_equal("\"abc", @:) + call feedkeys("/abc\", 'xt') + call assert_equal([2, 1], [line('.'), col('.')]) + call feedkeys("/\abc\\", 'xt') + call assert_equal([2, 1], [line('.'), col('.')]) + + set imsearch=2 + call cursor(1, 1) + call feedkeys("/abc\", 'xt') + call assert_equal([2, 1], [line('.'), col('.')]) + call cursor(1, 1) + call feedkeys("/\abc\\", 'xt') + call assert_equal([2, 1], [line('.'), col('.')]) + set imdisable + call feedkeys("/\abc\\", 'xt') + call assert_equal([2, 1], [line('.'), col('.')]) + set imdisable& + set imsearch& + + set imcmdline& + %bwipe! + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.0341/src/testdir/test_ex_mode.vim 2020-02-27 21:32:38.681185130 +0100 --- src/testdir/test_ex_mode.vim 2020-03-01 16:49:39.419245507 +0100 *************** *** 49,54 **** --- 49,56 ---- call assert_equal([' foo', ' foo'], Ex(" foo\"), e) call assert_equal(['foo', ' foo0'], Ex(" foo0\"), e) call assert_equal(['foo', ' foo^'], Ex(" foo^\"), e) + call assert_equal(['foo', 'foo'], + \ Ex("\\\foo"), e) endfor set sw& *************** *** 128,131 **** --- 130,142 ---- call assert_equal("a\rb", l) endfunc + " Test for :append! command in Ex mode + func Test_Ex_append() + new + call setline(1, "\t abc") + call feedkeys("Qappend!\npqr\nxyz\n.\nvisual\n", 'xt') + call assert_equal(["\t abc", "\t pqr", "\t xyz"], getline(1, '$')) + close! + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.0341/src/testdir/test_history.vim 2020-02-27 21:32:38.681185130 +0100 --- src/testdir/test_history.vim 2020-03-01 16:49:39.419245507 +0100 *************** *** 114,119 **** --- 114,120 ---- bwipe! endfunc + " Test for :history command option completion function Test_history_completion() call feedkeys(":history \\\"\", 'tx') call assert_equal('"history / : = > ? @ all cmd debug expr input search', @:) *************** *** 122,129 **** " Test for increasing the 'history' option value func Test_history_size() let save_histsz = &history - call histdel(':') set history=10 for i in range(1, 5) call histadd(':', 'cmd' .. i) endfor --- 123,131 ---- " Test for increasing the 'history' option value func Test_history_size() let save_histsz = &history set history=10 + call histadd(':', 'ls') + call histdel(':') for i in range(1, 5) call histadd(':', 'cmd' .. i) endfor *************** *** 173,178 **** --- 175,187 ---- call assert_equal(['pat2', 'pat1', ''], g:pat) cunmap delfunc SavePat + + " Recall patterns with 'history' set to 0 + set history=0 + let @/ = 'abc' + let cmd = 'call feedkeys("/\\\\\", "xt")' + call assert_fails(cmd, 'E486:') + set history& endfunc " Test for making sure the key value is not stored in history *** ../vim-8.2.0341/src/testdir/test_iminsert.vim 2019-12-07 21:40:17.000000000 +0100 --- src/testdir/test_iminsert.vim 2020-03-01 16:49:39.419245507 +0100 *************** *** 62,64 **** --- 62,66 ---- set imactivatefunc= set imstatusfunc= endfunc + + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.0341/src/version.c 2020-03-01 16:22:37.064963530 +0100 --- src/version.c 2020-03-01 16:50:35.975046885 +0100 *************** *** 740,741 **** --- 740,743 ---- { /* Add new patch number below this line */ + /**/ + 342, /**/ -- hundred-and-one symptoms of being an internet addict: 149. You find your computer sexier than your girlfriend /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///