To: vim_dev@googlegroups.com Subject: Patch 8.2.2643 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2643 Problem: Various code not covered by tests. Solution: Add a few more test. (Yegappan Lakshmanan, closes #7995) Files: src/testdir/test_edit.vim, src/testdir/test_functions.vim, src/testdir/test_mapping.vim, src/testdir/test_termcodes.vim, src/testdir/test_undo.vim *** ../vim-8.2.2642/src/testdir/test_edit.vim 2021-03-19 14:38:07.869248401 +0100 --- src/testdir/test_edit.vim 2021-03-22 19:34:36.525309109 +0100 *************** *** 411,416 **** --- 411,443 ---- bwipe! endfunc + " Test for autoindent removing indent when insert mode is stopped. Some parts + " of the code is exercised only when interactive mode is used. So use Vim in a + " terminal. + func Test_autoindent_remove_indent() + CheckRunVimInTerminal + let buf = RunVimInTerminal('-N Xfile', {'rows': 6, 'cols' : 20}) + call TermWait(buf) + call term_sendkeys(buf, ":set autoindent\n") + " leaving insert mode in a new line with indent added by autoindent, should + " remove the indent. + call term_sendkeys(buf, "i\foo\\") + " Need to delay for sometime, otherwise the code in getchar.c will not be + " exercised. + call TermWait(buf, 50) + " when a line is wrapped and the cursor is at the start of the second line, + " leaving insert mode, should move the cursor back to the first line. + call term_sendkeys(buf, "o" .. repeat('x', 20) .. "\") + " Need to delay for sometime, otherwise the code in getchar.c will not be + " exercised. + call TermWait(buf, 50) + call term_sendkeys(buf, ":w\n") + call TermWait(buf) + call StopVimInTerminal(buf) + call assert_equal(["\tfoo", '', repeat('x', 20)], readfile('Xfile')) + call delete('Xfile') + endfunc + func Test_edit_CR() " Test for in insert mode " basically only in quickfix mode ist tested, the rest *** ../vim-8.2.2642/src/testdir/test_functions.vim 2021-03-15 18:36:16.725494781 +0100 --- src/testdir/test_functions.vim 2021-03-22 19:34:36.525309109 +0100 *************** *** 1431,1437 **** call assert_equal('item1 item2 item3', c) " Test for using special characters as default input ! call feedkeys(":let c = input('name? ', \"x\y\")\\", 'xt') call assert_equal('y', c) " Test for using as default input --- 1431,1437 ---- call assert_equal('item1 item2 item3', c) " Test for using special characters as default input ! call feedkeys(":let c = input('name? ', \"x\\y\")\\", 'xt') call assert_equal('y', c) " Test for using as default input *** ../vim-8.2.2642/src/testdir/test_mapping.vim 2021-03-17 13:39:30.657050576 +0100 --- src/testdir/test_mapping.vim 2021-03-22 19:34:36.525309109 +0100 *************** *** 1389,1392 **** --- 1389,1402 ---- ounmap i- endfunc + " Test for using