To: vim_dev@googlegroups.com Subject: Patch 8.2.2608 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2608 Problem: Character input not fully tested. Solution: Add more tests. (Yegappan Lakshmanan, closes #7963) Files: src/testdir/test_functions.vim, src/testdir/test_messages.vim, src/testdir/test_paste.vim, src/testdir/test_registers.vim, src/testdir/test_undo.vim *** ../vim-8.2.2607/src/testdir/test_functions.vim 2021-02-04 22:07:13.460979948 +0100 --- src/testdir/test_functions.vim 2021-03-15 18:33:57.773724054 +0100 *************** *** 1430,1435 **** --- 1430,1443 ---- delfunc Tcomplete 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 + call feedkeys(":let c = input('name? ', \"\\\")\x\", 'xt') + call assert_equal(' x', c) + call assert_fails("call input('F:', '', 'invalid')", 'E180:') call assert_fails("call input('F:', '', [])", 'E730:') endfunc *** ../vim-8.2.2607/src/testdir/test_messages.vim 2020-12-08 20:39:11.361180690 +0100 --- src/testdir/test_messages.vim 2021-03-15 18:33:57.773724054 +0100 *************** *** 259,264 **** --- 259,275 ---- call term_sendkeys(buf, 'q') call WaitForAssert({-> assert_equal('100', term_getline(buf, 5))}) + " Execute a : command from the more prompt + call term_sendkeys(buf, ":%p#\n") + call term_wait(buf) + call WaitForAssert({-> assert_equal('-- More --', term_getline(buf, 6))}) + call term_sendkeys(buf, ":") + call term_wait(buf) + call WaitForAssert({-> assert_equal(':', term_getline(buf, 6))}) + call term_sendkeys(buf, "echo 'Hello'\n") + call term_wait(buf) + call WaitForAssert({-> assert_equal('Hello ', term_getline(buf, 5))}) + call StopVimInTerminal(buf) endfunc *** ../vim-8.2.2607/src/testdir/test_paste.vim 2020-08-12 18:50:31.883655785 +0200 --- src/testdir/test_paste.vim 2021-03-15 18:33:57.773724054 +0100 *************** *** 149,152 **** --- 149,166 ---- bwipe! endfunc + " Test for 'pastetoggle' + func Test_pastetoggle() + new + set pastetoggle= + set nopaste + call feedkeys("iHello\", 'xt') + call assert_true(&paste) + call feedkeys("i\", 'xt') + call assert_false(&paste) + call assert_equal('Hello', getline(1)) + set pastetoggle& + bwipe! + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.2607/src/testdir/test_registers.vim 2020-12-23 12:50:16.575182402 +0100 --- src/testdir/test_registers.vim 2021-03-15 18:33:57.773724054 +0100 *************** *** 709,712 **** --- 709,722 ---- bwipe! endfunc + " Record in insert mode using CTRL-O + func Test_record_in_insert_mode() + new + let @r = '' + call setline(1, ['foo']) + call feedkeys("i\qrbaz\q", 'xt') + call assert_equal('baz', @r) + bwipe! + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.2607/src/testdir/test_undo.vim 2020-10-04 19:56:35.163869162 +0200 --- src/testdir/test_undo.vim 2021-03-15 18:33:57.777724047 +0100 *************** *** 733,736 **** --- 733,750 ---- set undofile& undolevels& cryptmethod& endfunc + " Test for redoing with incrementing numbered registers + func Test_redo_repeat_numbered_register() + new + for [i, v] in [[1, 'one'], [2, 'two'], [3, 'three'], + \ [4, 'four'], [5, 'five'], [6, 'six'], + \ [7, 'seven'], [8, 'eight'], [9, 'nine']] + exe 'let @' .. i .. '="' .. v .. '\n"' + endfor + call feedkeys('"1p.........', 'xt') + call assert_equal(['', 'one', 'two', 'three', 'four', 'five', 'six', + \ 'seven', 'eight', 'nine', 'nine'], getline(1, '$')) + bwipe! + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.2607/src/version.c 2021-03-14 19:46:22.007284572 +0100 --- src/version.c 2021-03-15 18:35:36.969561919 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2608, /**/ -- The only way the average employee can speak to an executive is by taking a second job as a golf caddie. (Scott Adams - The Dilbert principle) /// 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 ///