To: vim_dev@googlegroups.com Subject: Patch 8.2.0369 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0369 Problem: Various Normal mode commands not fully tested. Solution: Add more tests. (Yegappan Lakshmanan, closes #5751) Files: src/testdir/test_arglist.vim, src/testdir/test_changelist.vim, src/testdir/test_charsearch.vim, src/testdir/test_cmdline.vim, src/testdir/test_edit.vim, src/testdir/test_ex_mode.vim, src/testdir/test_excmd.vim, src/testdir/test_gf.vim, src/testdir/test_iminsert.vim, src/testdir/test_increment.vim, src/testdir/test_marks.vim, src/testdir/test_normal.vim, src/testdir/test_prompt_buffer.vim, src/testdir/test_put.vim, src/testdir/test_registers.vim, src/testdir/test_tagjump.vim, src/testdir/test_visual.vim *** ../vim-8.2.0368/src/testdir/test_arglist.vim 2020-02-21 17:54:41.830235712 +0100 --- src/testdir/test_arglist.vim 2020-03-10 07:37:06.878687432 +0100 *************** *** 539,544 **** --- 539,549 ---- call term_wait(buf) call WaitForAssert({-> assert_equal("finished", term_getstatus(buf))}) only! + " When this test fails, swap files are left behind which breaks subsequent + " tests + call delete('.a.swp') + call delete('.b.swp') + call delete('.c.swp') endfunc " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.0368/src/testdir/test_changelist.vim 2019-08-24 22:22:31.000000000 +0200 --- src/testdir/test_changelist.vim 2020-03-10 07:37:06.878687432 +0100 *************** *** 46,48 **** --- 46,50 ---- call delete('Xfile1.txt') call delete('Xfile2.txt') endfunc + + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.0368/src/testdir/test_charsearch.vim 2019-09-06 21:22:54.000000000 +0200 --- src/testdir/test_charsearch.vim 2020-03-10 07:37:06.878687432 +0100 *************** *** 1,3 **** --- 1,4 ---- + " Test for character search commands - t, T, f, F, ; and , func Test_charsearch() enew! *************** *** 60,62 **** --- 61,76 ---- call assert_equal('ddd yee y', getline(6)) enew! endfunc + + " Test for character search in virtual edit mode with + func Test_csearch_virtualedit() + new + set virtualedit=all + call setline(1, "a\tb") + normal! tb + call assert_equal([0, 1, 2, 6], getpos('.')) + set virtualedit& + close! + endfunc + + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.0368/src/testdir/test_cmdline.vim 2020-03-08 05:13:10.007536782 +0100 --- src/testdir/test_cmdline.vim 2020-03-10 07:37:06.878687432 +0100 *************** *** 957,962 **** --- 957,966 ---- func Test_cmdwin_feedkeys() " This should not generate E488 call feedkeys("q:\", 'x') + " Using feedkeys with q: only should automatically close the cmd window + call feedkeys('q:', 'xt') + call assert_equal(1, winnr('$')) + call assert_equal('', getcmdwintype()) endfunc " Tests for the issues fixed in 7.4.441. *** ../vim-8.2.0368/src/testdir/test_edit.vim 2020-03-08 05:13:10.007536782 +0100 --- src/testdir/test_edit.vim 2020-03-10 07:37:06.882687417 +0100 *************** *** 281,287 **** call cursor(2, 1) call feedkeys("i\int c;\", 'tnix') call cursor(3, 1) ! call feedkeys("i/* comment */", 'tnix') call assert_equal(['{', "\int c;", "/* comment */"], getline(1, '$')) " added changed cindentkeys slightly set cindent cinkeys+=*/ --- 281,287 ---- call cursor(2, 1) call feedkeys("i\int c;\", 'tnix') call cursor(3, 1) ! call feedkeys("\/* comment */", 'tnix') call assert_equal(['{', "\int c;", "/* comment */"], getline(1, '$')) " added changed cindentkeys slightly set cindent cinkeys+=*/ *************** *** 1267,1282 **** catch /^Vim\%((\a\+)\)\=:E117/ " catch E117: unknown function endtry au! InsertCharPre - " Not allowed to enter ex mode when text is locked - au InsertCharPre :normal! gQ - let caught_e523 = 0 - try - call feedkeys("ix\", 'xt') - catch /^Vim\%((\a\+)\)\=:E523/ " catch E523 - let caught_e523 = 1 - endtry - call assert_equal(1, caught_e523) - au! InsertCharPre " 3) edit when completion is shown fun! Complete(findstart, base) if a:findstart --- 1267,1272 ---- *************** *** 1550,1553 **** --- 1540,1575 ---- set esckeys endfunc + " Test for running an invalid ex command in insert mode using CTRL-O + " Note that vim has a hard-coded sleep of 3 seconds. So this test will take + " more than 3 seconds to complete. + func Test_edit_ctrl_o_invalid_cmd() + new + set showmode showcmd + let caught_e492 = 0 + try + call feedkeys("i\:invalid\abc\", "xt") + catch /E492:/ + let caught_e492 = 1 + endtry + call assert_equal(1, caught_e492) + call assert_equal('abc', getline(1)) + set showmode& showcmd& + close! + endfunc + + " Test for inserting text at the beginning of a line + func Test_insert_before_first_nonblank() + new + call setline(1, ' ') + normal! Ia + call assert_equal(' a', getline(1)) + set cpo+=H + call setline(1, ' ') + normal! Ia + call assert_equal(' a ', getline(1)) + set cpo-=H + close! + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.0368/src/testdir/test_ex_mode.vim 2020-03-06 20:35:46.120669845 +0100 --- src/testdir/test_ex_mode.vim 2020-03-10 07:37:06.882687417 +0100 *************** *** 158,161 **** --- 158,174 ---- \ "E15: Invalid expression: \\\nm") endfunc + func Test_ex_mode_errors() + " Not allowed to enter ex mode when text is locked + au InsertCharPre normal! gQ + let caught_e523 = 0 + try + call feedkeys("ix\", 'xt') + catch /^Vim\%((\a\+)\)\=:E523/ " catch E523 + let caught_e523 = 1 + endtry + call assert_equal(1, caught_e523) + au! InsertCharPre + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.0368/src/testdir/test_excmd.vim 2020-02-21 17:54:41.830235712 +0100 --- src/testdir/test_excmd.vim 2020-03-10 07:37:06.882687417 +0100 *************** *** 57,62 **** --- 57,66 ---- 1,3copy 2 call assert_equal(['L1', 'L2', 'L1', 'L2', 'L3', 'L3', 'L4'], getline(1, 7)) + " Specifying a count before using : to run an ex-command + exe "normal! gg4:yank\" + call assert_equal("L1\nL2\nL1\nL2\n", @") + close! endfunc *** ../vim-8.2.0368/src/testdir/test_gf.vim 2019-12-22 15:38:02.350438554 +0100 --- src/testdir/test_gf.vim 2020-03-10 07:37:06.882687417 +0100 *************** *** 130,134 **** --- 130,149 ---- call setline(1, '/doesnotexist') call assert_fails('normal gf', 'E447:') call assert_fails('normal gF', 'E447:') + call assert_fails('normal [f', 'E447:') + + " gf is not allowed when text is locked + au InsertCharPre normal! gF + let caught_e523 = 0 + try + call feedkeys("ix\", 'xt') + catch /^Vim\%((\a\+)\)\=:E523/ " catch E523 + let caught_e523 = 1 + endtry + call assert_equal(1, caught_e523) + au! InsertCharPre + bwipe! endfunc + + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.0368/src/testdir/test_iminsert.vim 2020-03-01 16:53:06.378524819 +0100 --- src/testdir/test_iminsert.vim 2020-03-10 07:37:06.882687417 +0100 *************** *** 63,66 **** --- 63,86 ---- set imstatusfunc= endfunc + " Test for using an lmap in insert mode + func Test_lmap_in_insert_mode() + new + call setline(1, 'abc') + lmap { w + set iminsert=1 + call feedkeys('r{', 'xt') + call assert_equal('wbc', getline(1)) + set iminsert=2 + call feedkeys('$r{', 'xt') + call assert_equal('wb{', getline(1)) + call setline(1, 'vim web') + set iminsert=1 + call feedkeys('0f{', 'xt') + call assert_equal(5, col('.')) + set iminsert& + lunmap { + close! + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.0368/src/testdir/test_increment.vim 2017-12-05 17:12:34.000000000 +0100 --- src/testdir/test_increment.vim 2020-03-10 07:37:06.882687417 +0100 *************** *** 775,780 **** --- 775,788 ---- call setline(1, ['0', '0', '0', '0', '0', '0', '']) exe "normal Gvgg\" call assert_equal(['1', '1', '1', '1', '1', '1', ''], getline(1, 7)) + + " Ctrl-A/Ctrl-X should do nothing in operator pending mode + %d + call setline(1, 'one two') + exe "normal! c\l" + exe "normal! c\l" + call assert_equal('one two', getline(1)) + bwipe! endfunc *** ../vim-8.2.0368/src/testdir/test_marks.vim 2020-02-16 13:33:52.047371845 +0100 --- src/testdir/test_marks.vim 2020-03-10 07:37:06.882687417 +0100 *************** *** 195,200 **** --- 195,201 ---- call assert_fails('mark', 'E471:') call assert_fails('mark xx', 'E488:') call assert_fails('mark _', 'E191:') + call assert_beeps('normal! m~') endfunc " Test for :lockmarks when pasting content *************** *** 221,224 **** --- 222,248 ---- close! endfunc + " Test for file marks (A-Z) + func Test_file_mark() + new Xone + call setline(1, ['aaa', 'bbb']) + norm! G$mB + w! + new Xtwo + call setline(1, ['ccc', 'ddd']) + norm! GmD + w! + + enew + normal! `B + call assert_equal('Xone', bufname()) + call assert_equal([2, 3], [line('.'), col('.')]) + normal! 'D + call assert_equal('Xtwo', bufname()) + call assert_equal([2, 1], [line('.'), col('.')]) + + call delete('Xone') + call delete('Xtwo') + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.0368/src/testdir/test_normal.vim 2020-03-08 05:13:10.007536782 +0100 --- src/testdir/test_normal.vim 2020-03-10 07:37:06.882687417 +0100 *************** *** 54,60 **** let g:bufnr=bufnr('%') endfunc ! fun! Test_normal00_optrans() new call append(0, ['1 This is a simple test: abcd', '2 This is the second line', '3 this is the third line']) 1 --- 54,60 ---- let g:bufnr=bufnr('%') endfunc ! func Test_normal00_optrans() new call append(0, ['1 This is a simple test: abcd', '2 This is the second line', '3 this is the third line']) 1 *************** *** 95,100 **** --- 95,106 ---- 50 call feedkeys("\y", 'tx') call assert_equal(['49', '5'], getreg(0, 0, 1)) + " Use the different Shift special keys + 50 + call feedkeys("\\\\\\y", 'tx') + call assert_equal(['50'], getline("'<", "'>")) + call assert_equal(['50', ''], getreg(0, 0, 1)) + " Do not start visual mode when keymodel= set keymodel= 50 *************** *** 434,441 **** bw! endfunc func Test_normal12_nv_error() - " Test for nv_error 10new call setline(1, range(1,5)) " should not do anything, just beep --- 440,447 ---- bw! endfunc + " Test for nv_error and normal command errors func Test_normal12_nv_error() 10new call setline(1, range(1,5)) " should not do anything, just beep *************** *** 445,450 **** --- 451,472 ---- call assert_beeps("normal! g\") call assert_beeps("normal! g\") call assert_beeps("normal! g\") + call assert_beeps("normal! vQ\") + call assert_beeps("normal! 2[[") + call assert_beeps("normal! 2]]") + call assert_beeps("normal! 2[]") + call assert_beeps("normal! 2][") + call assert_beeps("normal! 4[z") + call assert_beeps("normal! 4]z") + call assert_beeps("normal! 4[c") + call assert_beeps("normal! 4]c") + call assert_beeps("normal! 200%") + call assert_beeps("normal! %") + call assert_beeps("normal! 2{") + call assert_beeps("normal! 2}") + call assert_beeps("normal! r\") + call assert_beeps("normal! 8ry") + call assert_beeps('normal! "@') bw! endfunc *************** *** 500,505 **** --- 522,533 ---- bw! endfunc + " Test for errors with z command + func Test_normal_z_error() + call assert_beeps('normal! z2p') + call assert_beeps('normal! zp') + endfunc + func Test_normal15_z_scroll_vert() " basic test for z commands that scroll the window call Setup_NewWindow() *************** *** 600,605 **** --- 628,640 ---- $put =lineB 1d + " Test for zl and zh with a count + norm! 0z10l + call assert_equal([11, 1], [col('.'), wincol()]) + norm! z4h + call assert_equal([11, 5], [col('.'), wincol()]) + normal! 2gg + " Test for zl 1 norm! 5zl *************** *** 722,727 **** --- 757,783 ---- bw! endfunc + " Test for H, M and L commands with folds + func Test_scroll_cmds() + 15new + call setline(1, range(1, 100)) + exe "normal! 30ggz\" + set foldenable + 33,36fold + 40,43fold + 46,49fold + let h = winheight(0) + " Top of the screen = 30 + " Folded lines = 9 + " Bottom of the screen = 30 + h + 9 - 1 + normal! 4L + call assert_equal(35 + h, line('.')) + normal! 4H + call assert_equal(33, line('.')) + set foldenable& + close! + endfunc + func Test_normal18_z_fold() " basic tests for foldopen/folddelete if !has("folding") *************** *** 731,736 **** --- 787,795 ---- 50 setl foldenable fdm=marker foldlevel=5 + call assert_beeps('normal! zj') + call assert_beeps('normal! zk') + " Test for zF " First fold norm! 4zF *************** *** 1157,1162 **** --- 1216,1224 ---- let a = readfile('Xfile') call assert_equal(['1', '2'], a) + " Unsupported Z command + call assert_beeps('normal! ZW') + " clean up for file in ['Xfile'] call delete(file) *************** *** 1225,1230 **** --- 1287,1301 ---- call assert_match("man --pager=cat 'man'", a) endif + " Error cases + call setline(1, '#$#') + call assert_fails('normal! ggK', 'E349:') + call setline(1, '---') + call assert_fails('normal! ggv2lK', 'E349:') + call setline(1, ['abc', 'xyz']) + call assert_fails("normal! gg2lv2h\", 'E426:') + call assert_beeps("normal! ggVjK") + " clean up let &keywordprg = k bw! *************** *** 1383,1390 **** bw! endfunc func Test_normal28_parenthesis() - " basic testing for ( and ) new call append(0, ['This is a test. With some sentences!', '', 'Even with a question? And one more. And no sentence here']) --- 1454,1461 ---- bw! endfunc + " Test for ( and ) sentence movements func Test_normal28_parenthesis() new call append(0, ['This is a test. With some sentences!', '', 'Even with a question? And one more. And no sentence here']) *************** *** 1402,1413 **** norm! $d( call assert_equal(['With some sentences!', '', ' ', '', 'This is a long sentence', ''], getline(1, '$')) " clean up bw! endfunc ! fun! Test_normal29_brace() ! " basic test for { and } movements let text =<< trim [DATA] A paragraph begins after each empty line, and also at each of a set of paragraph macros, specified by the pairs of characters in the 'paragraphs' --- 1473,1499 ---- norm! $d( call assert_equal(['With some sentences!', '', ' ', '', 'This is a long sentence', ''], getline(1, '$')) + " It is an error if a next sentence is not found + %d + call setline(1, '.SH') + call assert_beeps('normal )') + + " Jumping to a fold should open the fold + call setline(1, ['', '', 'one', 'two', 'three']) + set foldenable + 2,$fold + call feedkeys(')', 'xt') + call assert_equal(3, line('.')) + call assert_equal(1, foldlevel('.')) + call assert_equal(-1, foldclosed('.')) + set foldenable& + " clean up bw! endfunc ! " Test for { and } paragraph movements ! func Test_normal29_brace() let text =<< trim [DATA] A paragraph begins after each empty line, and also at each of a set of paragraph macros, specified by the pairs of characters in the 'paragraphs' *************** *** 1561,1572 **** [DATA] call assert_equal(expected, getline(1, '$')) " clean up set cpo-={ bw! endfunc ! fun! Test_normal30_changecase() new call append(0, 'This is a simple test: äüöß') norm! 1ggVu --- 1647,1670 ---- [DATA] call assert_equal(expected, getline(1, '$')) + " Jumping to a fold should open the fold + %d + call setline(1, ['', 'one', 'two', '']) + set foldenable + 2,$fold + call feedkeys('}', 'xt') + call assert_equal(4, line('.')) + call assert_equal(1, foldlevel('.')) + call assert_equal(-1, foldclosed('.')) + set foldenable& + " clean up set cpo-={ bw! endfunc ! " Test for ~ command ! func Test_normal30_changecase() new call append(0, 'This is a simple test: äüöß') norm! 1ggVu *************** *** 1586,1593 **** norm! V~ call assert_equal('THIS IS A simple test: äüöss', getline('.')) ! " Turkish ASCII turns to multi-byte. On some systems Turkish locale ! " is available but toupper()/tolower() don't do the right thing. try lang tr_TR.UTF-8 set casemap= --- 1684,1706 ---- norm! V~ call assert_equal('THIS IS A simple test: äüöss', getline('.')) ! " Test for changing case across lines using 'whichwrap' ! call setline(1, ['aaaaaa', 'aaaaaa']) ! normal! gg10~ ! call assert_equal(['AAAAAA', 'aaaaaa'], getline(1, 2)) ! set whichwrap+=~ ! normal! gg10~ ! call assert_equal(['aaaaaa', 'AAAAaa'], getline(1, 2)) ! set whichwrap& ! ! " clean up ! bw! ! endfunc ! ! " Turkish ASCII turns to multi-byte. On some systems Turkish locale ! " is available but toupper()/tolower() don't do the right thing. ! func Test_normal_changecase_turkish() ! new try lang tr_TR.UTF-8 set casemap= *************** *** 1631,1651 **** " can't use Turkish locale throw 'Skipped: Turkish locale not available' endtry ! ! call setline(1, ['aaaaaa', 'aaaaaa']) ! normal! gg10~ ! call assert_equal(['AAAAAA', 'aaaaaa'], getline(1, 2)) ! set whichwrap+=~ ! normal! gg10~ ! call assert_equal(['aaaaaa', 'AAAAaa'], getline(1, 2)) ! set whichwrap& ! ! " clean up ! bw! endfunc ! fun! Test_normal31_r_cmd() ! " Test for r command new call append(0, 'This is a simple test: abcd') exe "norm! 1gg$r\" --- 1744,1754 ---- " can't use Turkish locale throw 'Skipped: Turkish locale not available' endtry ! close! endfunc ! " Test for r (replace) command ! func Test_normal31_r_cmd() new call append(0, 'This is a simple test: abcd') exe "norm! 1gg$r\" *************** *** 1664,1669 **** --- 1767,1788 ---- exe "norm! 1gg05rf" call assert_equal('fffffis a', getline(1)) + " When replacing characters, copy characters from above and below lines + " using CTRL-Y and CTRL-E. + " Different code paths are used for utf-8 and latin1 encodings + set showmatch + for enc in ['latin1', 'utf-8'] + enew! + let &encoding = enc + call setline(1, [' {a}', 'xxxxxxxxxx', ' [b]']) + exe "norm! 2gg5r\l5r\" + call assert_equal(' {a}x [b]x', getline(2)) + endfor + set showmatch& + + " r command should fail in operator pending mode + call assert_beeps('normal! cr') + " clean up set noautoindent bw! *************** *** 1687,1693 **** " Test for g`, g;, g,, g&, gv, gk, gj, gJ, g0, g^, g_, gm, g$, gM, g CTRL-G, " gi and gI commands ! fun! Test_normal33_g_cmd2() if !has("jumplist") return endif --- 1806,1812 ---- " Test for g`, g;, g,, g&, gv, gk, gj, gJ, g0, g^, g_, gm, g$, gM, g CTRL-G, " gi and gI commands ! func Test_normal33_g_cmd2() if !has("jumplist") return endif *************** *** 1736,1741 **** --- 1855,1870 ---- norm! g& call assert_equal(['11', '22', '33', '44', '55', '66', '77', '88', '9', '110', 'a', 'b', 'c', 'dd'], getline(1, '$')) + " Jumping to a fold using gg should open the fold + set foldenable + set foldopen+=jump + 5,8fold + call feedkeys('6gg', 'xt') + call assert_equal(1, foldlevel('.')) + call assert_equal(-1, foldclosed('.')) + set foldopen-=jump + set foldenable& + " Test for gv %d call append('$', repeat(['abcdefgh'], 8)) *************** *** 1849,1854 **** --- 1978,1987 ---- call assert_equal('foo first line', getline(1)) set virtualedit& + " Test for aboring a g command using CTRL-\ CTRL-G + exe "normal! g\\" + call assert_equal('foo first line', getline('.')) + " clean up bw! endfunc *************** *** 1860,1865 **** --- 1993,2002 ---- let a = execute(":norm! g\") call assert_equal("\n--No lines in buffer--", a) + " Test for CTRL-G (same as :file) + let a = execute(":norm! \") + call assert_equal("\n\n\"[No Name]\" --No lines in buffer--", a) + call setline(1, ['first line', 'second line']) " Test g CTRL-g with dos, mac and unix file type. *************** *** 1928,1934 **** endfunc " Test for g8 ! fun! Test_normal34_g_cmd3() new let a=execute(':norm! 1G0g8') call assert_equal("\nNUL", a) --- 2065,2071 ---- endfunc " Test for g8 ! func Test_normal34_g_cmd3() new let a=execute(':norm! 1G0g8') call assert_equal("\nNUL", a) *************** *** 1978,1984 **** endfunc " Test for g< ! fun! Test_normal35_g_cmd4() " Cannot capture its output, " probably a bug, therefore, test disabled: throw "Skipped: output of g< can't be tested currently" --- 2115,2121 ---- endfunc " Test for g< ! func Test_normal35_g_cmd4() " Cannot capture its output, " probably a bug, therefore, test disabled: throw "Skipped: output of g< can't be tested currently" *************** *** 1988,1994 **** endfunc " Test for gp gP go ! fun! Test_normal36_g_cmd5() new call append(0, 'abcdefghijklmnopqrstuvwxyz') set ff=unix --- 2125,2131 ---- endfunc " Test for gp gP go ! func Test_normal36_g_cmd5() new call append(0, 'abcdefghijklmnopqrstuvwxyz') set ff=unix *************** *** 2027,2033 **** endfunc " Test for gt and gT ! fun! Test_normal37_g_cmd6() tabnew 1.txt tabnew 2.txt tabnew 3.txt --- 2164,2170 ---- endfunc " Test for gt and gT ! func Test_normal37_g_cmd6() tabnew 1.txt tabnew 2.txt tabnew 3.txt *************** *** 2054,2060 **** endfunc " Test for and key ! fun! Test_normal38_nvhome() new call setline(1, range(10)) $ --- 2191,2197 ---- endfunc " Test for and key ! func Test_normal38_nvhome() new call setline(1, range(10)) $ *************** *** 2076,2083 **** bw! endfunc " Test for cw cW ce ! fun! Test_normal39_cw() " Test for cw and cW on whitespace " and cpo+=w setting new --- 2213,2233 ---- bw! endfunc + " Test for and keys + func Test_normal_nvend() + new + call setline(1, map(range(1, 10), '"line" .. v:val')) + exe "normal! \" + call assert_equal(5, col('.')) + exe "normal! 4\" + call assert_equal([4, 5], [line('.'), col('.')]) + exe "normal! \" + call assert_equal([10, 6], [line('.'), col('.')]) + close! + endfunc + " Test for cw cW ce ! func Test_normal39_cw() " Test for cw and cW on whitespace " and cpo+=w setting new *************** *** 2117,2123 **** endfunc " Test for CTRL-\ commands ! fun! Test_normal40_ctrl_bsl() new call append(0, 'here are some words') exe "norm! 1gg0a\\" --- 2267,2273 ---- endfunc " Test for CTRL-\ commands ! func Test_normal40_ctrl_bsl() new call append(0, 'here are some words') exe "norm! 1gg0a\\" *************** *** 2136,2148 **** set noim call assert_equal('are some words', getline(1)) call assert_false(&insertmode) " clean up bw! endfunc " Test for =, = and = in insert mode ! fun! Test_normal41_insert_reg() new set sts=2 sw=2 ts=8 tw=0 call append(0, ["aaa\tbbb\tccc", '', '', '']) --- 2286,2303 ---- set noim call assert_equal('are some words', getline(1)) call assert_false(&insertmode) + call assert_beeps("normal! \\", 'xt') + + " Using CTRL-\ CTRL-N in cmd window should close the window + call feedkeys("q:\\", 'xt') + call assert_equal('', getcmdwintype()) " clean up bw! endfunc " Test for =, = and = in insert mode ! func Test_normal41_insert_reg() new set sts=2 sw=2 ts=8 tw=0 call append(0, ["aaa\tbbb\tccc", '', '', '']) *************** *** 2198,2204 **** endfunc " Tests for text object aw ! fun! Test_normal43_textobject1() new call append(0, ['foobar,eins,foobar', 'foo,zwei,foo ']) " diw --- 2353,2359 ---- endfunc " Tests for text object aw ! func Test_normal43_textobject1() new call append(0, ['foobar,eins,foobar', 'foo,zwei,foo ']) " diw *************** *** 2434,2439 **** --- 2589,2596 ---- call assert_equal(19, col('.')) call feedkeys("\", 'tx') call assert_equal(18, col('.')) + call feedkeys("\", 'tx') + call assert_equal(19, col('.')) call feedkeys("\", 'tx') call assert_equal(13, col('.')) call feedkeys("\", 'tx') *************** *** 2557,2562 **** --- 2714,2721 ---- normal g; call assert_equal([2, 2], [line('.'), col('.')]) call assert_fails('normal g;', 'E662:') + new + call assert_fails('normal g;', 'E664:') %bwipe! let &ul = save_ul endfunc *************** *** 2603,2608 **** --- 2762,2771 ---- " Jumping to beginning and end of methods in Java-like languages func Test_java_motion() new + call assert_beeps('normal! [m') + call assert_beeps('normal! ]m') + call assert_beeps('normal! [M') + call assert_beeps('normal! ]M') a Piece of Java { *************** *** 2677,2683 **** close! endfunc ! fun! Test_normal_gdollar_cmd() if !has("jumplist") return endif --- 2840,2846 ---- close! endfunc ! func Test_normal_gdollar_cmd() if !has("jumplist") return endif *************** *** 2840,2851 **** endfunc " Test for 'b', 'B' 'ge' and 'gE' commands ! func Test_backward_motion() normal! gg call assert_beeps('normal! b') call assert_beeps('normal! B') call assert_beeps('normal! gE') call assert_beeps('normal! ge') endfunc " vim: shiftwidth=2 sts=2 expandtab --- 3003,3030 ---- endfunc " Test for 'b', 'B' 'ge' and 'gE' commands ! func Test_horiz_motion() ! new normal! gg call assert_beeps('normal! b') call assert_beeps('normal! B') call assert_beeps('normal! gE') call assert_beeps('normal! ge') + " moves one word left and moves one WORD left + call setline(1, 'one ,two ,three') + exe "normal! $\" + call assert_equal(11, col('.')) + exe "normal! $\" + call assert_equal(10, col('.')) + close! + endfunc + + " Test for using a : command in operator pending mode + func Test_normal_colon_op() + new + call setline(1, ['one', 'two']) + call assert_beeps("normal! Gc:d\") + close! endfunc " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.0368/src/testdir/test_prompt_buffer.vim 2020-03-08 05:13:10.007536782 +0100 --- src/testdir/test_prompt_buffer.vim 2020-03-10 07:37:06.882687417 +0100 *************** *** 132,137 **** --- 132,147 ---- normal! i call assert_beeps('normal! dd') call assert_beeps('normal! ~') + call assert_beeps('normal! o') + call assert_beeps('normal! O') + call assert_beeps('normal! p') + call assert_beeps('normal! P') + call assert_beeps('normal! u') + call assert_beeps('normal! ra') + call assert_beeps('normal! s') + call assert_beeps('normal! S') + call assert_beeps("normal! \") + call assert_beeps("normal! \") close! endfunc *** ../vim-8.2.0368/src/testdir/test_put.vim 2019-09-06 22:28:49.000000000 +0200 --- src/testdir/test_put.vim 2020-03-10 07:37:06.882687417 +0100 *************** *** 113,115 **** --- 113,127 ---- call assert_equal('select that text', getline(2)) bwipe! endfunc + + " Test for deleting all the contents of a buffer with a put + func Test_put_visual_delete_all_lines() + new + call setline(1, ['one', 'two', 'three']) + let @r = '' + normal! VG"rgp + call assert_equal(1, line('$')) + close! + endfunc + + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.0368/src/testdir/test_registers.vim 2020-02-17 21:33:26.270098788 +0100 --- src/testdir/test_registers.vim 2020-03-10 07:37:06.882687417 +0100 *************** *** 395,400 **** --- 395,403 ---- @q @ call assert_equal(3, i) + + " cannot execute a register in operator pending mode + call assert_beeps('normal! c@r') endfunc " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.0368/src/testdir/test_tagjump.vim 2020-02-17 21:33:26.270098788 +0100 --- src/testdir/test_tagjump.vim 2020-03-10 07:37:06.882687417 +0100 *************** *** 1140,1146 **** " Test for :dsearch, :dlist, :djump and :dsplit commands " Test for [d, ]d, [D, ]D, [ CTRL-D, ] CTRL-D and CTRL-W d commands ! func Test_def_search() new call setline(1, ['#define FOO 1', '#define FOO 2', '#define FOO 3', \ '#define FOO 4', '#define FOO 5']) --- 1140,1146 ---- " Test for :dsearch, :dlist, :djump and :dsplit commands " Test for [d, ]d, [D, ]D, [ CTRL-D, ] CTRL-D and CTRL-W d commands ! func Test_macro_search() new call setline(1, ['#define FOO 1', '#define FOO 2', '#define FOO 3', \ '#define FOO 4', '#define FOO 5']) *************** *** 1236,1239 **** --- 1236,1270 ---- close! endfunc + " Test for [*, [/, ]* and ]/ + func Test_comment_search() + new + call setline(1, ['', '/*', ' *', ' *', ' */']) + normal! 4gg[/ + call assert_equal([2, 1], [line('.'), col('.')]) + normal! 3gg[* + call assert_equal([2, 1], [line('.'), col('.')]) + normal! 3gg]/ + call assert_equal([5, 3], [line('.'), col('.')]) + normal! 3gg]* + call assert_equal([5, 3], [line('.'), col('.')]) + %d + call setline(1, ['', '/*', ' *', ' *']) + call assert_beeps('normal! 3gg]/') + %d + call setline(1, ['', ' *', ' *', ' */']) + call assert_beeps('normal! 4gg[/') + %d + call setline(1, ' /* comment */') + normal! 15|[/ + call assert_equal(9, col('.')) + normal! 15|]/ + call assert_equal(21, col('.')) + call setline(1, ' comment */') + call assert_beeps('normal! 15|[/') + call setline(1, ' /* comment') + call assert_beeps('normal! 15|]/') + close! + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.0368/src/testdir/test_visual.vim 2020-03-08 05:13:10.007536782 +0100 --- src/testdir/test_visual.vim 2020-03-10 07:37:06.882687417 +0100 *************** *** 157,167 **** exe "norm! gvO\rb" exe "norm! gvo\rc" exe "norm! gvO\rd" call assert_equal(['..........', \ '...c d..', \ '... ..', ! \ '...a b..', \ '..........'], getline(1, '$')) enew! --- 157,172 ---- exe "norm! gvO\rb" exe "norm! gvo\rc" exe "norm! gvO\rd" + set selection=exclusive + exe "norm! gvOo\re" + call assert_equal('...a be.', getline(4)) + exe "norm! gvOO\rf" + set selection& call assert_equal(['..........', \ '...c d..', \ '... ..', ! \ '...a bf.', \ '..........'], getline(1, '$')) enew! *************** *** 645,650 **** --- 650,665 ---- exe "normal Gkgh\\\" call assert_equal(['', 'a', ''], getline(1, '$')) + " CTRL-H in select mode behaves like 'x' + call setline(1, 'abcdef') + exe "normal! gggh\\\\" + call assert_equal('ef', getline(1)) + + " CTRL-O in select mode switches to visual mode for one command + call setline(1, 'abcdef') + exe "normal! gggh\3lm" + call assert_equal('mef', getline(1)) + sunmap End> sunmap Down> sunmap Del> *************** *** 752,759 **** func Test_visual_block_mode() new call append(0, '') ! call setline(1, ['abcdefghijklm', 'abcdefghijklm', 'abcdefghijklm', ! \ 'abcdefghijklm', 'abcdefghijklm']) call cursor(1, 1) " Test shift-right of a block --- 767,773 ---- func Test_visual_block_mode() new call append(0, '') ! call setline(1, repeat(['abcdefghijklm'], 5)) call cursor(1, 1) " Test shift-right of a block *************** *** 772,777 **** --- 786,801 ---- \ 'axyzqqqqefgmnoklm', \ 'abcdqqqqijklm'], getline(1, 5)) + " Test 'C' to change till the end of the line + call cursor(3, 4) + exe "normal! \j3lCooo" + call assert_equal(['axyooo', 'axyooo'], getline(3, 4)) + + " Test 'D' to delete till the end of the line + call cursor(3, 3) + exe "normal! \j2lD" + call assert_equal(['ax', 'ax'], getline(3, 4)) + bwipe! endfunc *************** *** 958,965 **** close! endfunc ! " Test for starting visual mode with a count ! " This test should be run withou any previous visual modes. So this should be " run as a first test. func Test_AAA_start_visual_mode_with_count() new --- 982,989 ---- close! endfunc ! " Test for starting visual mode with a count. ! " This test should be run without any previous visual modes. So this should be " run as a first test. func Test_AAA_start_visual_mode_with_count() new *** ../vim-8.2.0368/src/version.c 2020-03-09 19:25:21.208186448 +0100 --- src/version.c 2020-03-10 07:39:30.694069682 +0100 *************** *** 740,741 **** --- 740,743 ---- { /* Add new patch number below this line */ + /**/ + 369, /**/ -- Spam seems to be something useful to novices. Later you realize that it's a bunch of indigestable junk that only clogs your system. Applies to both the food and the e-mail! /// 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 ///