To: vim_dev@googlegroups.com Subject: Patch 8.2.0347 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0347 Problem: Various code not covered by tests. Solution: Add more test coverage. (Yegappan Lakshmanan, closes #5720) Files: src/testdir/gen_opt_test.vim, src/testdir/test86.in, src/testdir/test_cmdline.vim, src/testdir/test_digraph.vim, src/testdir/test_ex_mode.vim, src/testdir/test_history.vim *** ../vim-8.2.0346/src/testdir/gen_opt_test.vim 2019-12-27 13:49:19.988946876 +0100 --- src/testdir/gen_opt_test.vim 2020-03-02 20:52:22.416001322 +0100 *************** *** 150,156 **** \ 'viminfo': [['', '''50', '"30'], ['xxx']], \ 'virtualedit': [['', 'all', 'all,block'], ['xxx']], \ 'whichwrap': [['', 'b,s', 'bs'], ['xxx']], ! \ 'wildmode': [['', 'full', 'list:full', 'full,longest'], ['xxx']], \ 'wildoptions': [['', 'tagfile'], ['xxx']], \ 'winaltkeys': [['menu', 'no'], ['', 'xxx']], \ --- 150,156 ---- \ 'viminfo': [['', '''50', '"30'], ['xxx']], \ 'virtualedit': [['', 'all', 'all,block'], ['xxx']], \ 'whichwrap': [['', 'b,s', 'bs'], ['xxx']], ! \ 'wildmode': [['', 'full', 'list:full', 'full,longest'], ['xxx', 'a4', 'full,full,full,full,full']], \ 'wildoptions': [['', 'tagfile'], ['xxx']], \ 'winaltkeys': [['menu', 'no'], ['', 'xxx']], \ *** ../vim-8.2.0346/src/testdir/test86.in 2019-12-01 14:25:26.000000000 +0100 --- src/testdir/test86.in 2020-03-02 20:52:22.416001322 +0100 *************** *** 1156,1162 **** :$put =string(pyeval('dd') is# pyeval('dd')) :$put =string(pyeval('df')) :delfunction Put ! py << EOF del DupDict del DupList del DupFun --- 1156,1162 ---- :$put =string(pyeval('dd') is# pyeval('dd')) :$put =string(pyeval('df')) :delfunction Put ! py << del DupDict del DupList del DupFun *************** *** 1164,1170 **** del dl del dl2 del df ! EOF :" :" Test chdir py << EOF --- 1164,1170 ---- del dl del dl2 del df ! . :" :" Test chdir py << EOF *** ../vim-8.2.0346/src/testdir/test_cmdline.vim 2020-03-01 16:53:06.378524819 +0100 --- src/testdir/test_cmdline.vim 2020-03-02 20:52:22.416001322 +0100 *************** *** 477,488 **** --- 477,498 ---- call feedkeys(":\"one\\two\", 'xt') call assert_equal('"onetwo', @:) + " Test for pasting register containing CTRL-H using CTRL-R and CTRL-R CTRL-R let @a = "xy\z" call feedkeys(":\"\a\", 'xt') call assert_equal('"xz', @:) + call feedkeys(":\"\\a\", 'xt') + call assert_equal("\"xy\z", @:) call feedkeys(":\"\\a\", 'xt') call assert_equal("\"xy\z", @:) + " Test for pasting register containing CTRL-V using CTRL-R and CTRL-R CTRL-R + let @a = "xy\z" + call feedkeys(":\"\=@a\\", 'xt') + call assert_equal('"xyz', @:) + call feedkeys(":\"\\=@a\\", 'xt') + call assert_equal("\"xy\z", @:) + call assert_beeps('call feedkeys(":\=\=\", "xt")') bwipe! *************** *** 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 " --- 1198,1204 ---- func Test_cmdline_edit() let str = ":one two\" let str ..= "one two\\" ! let str ..= "four\\\\" let str ..= "\five\" let str ..= "\two " let str ..= "\one " *************** *** 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 " --- 1217,1223 ---- set rightleftcmd=search let str = "/one two\" let str ..= "one two\\" ! let str ..= "four\\\\" let str ..= "\five\" let str ..= "\two " let str ..= "\one " *************** *** 1268,1271 **** --- 1278,1319 ---- %bwipe! endfunc + " Test for opening the command-line window when too many windows are present + func Test_cmdwin_fail_to_open() + " Open as many windows as possible + for i in range(100) + try + new + catch /E36:/ + break + endtry + endfor + call assert_beeps('call feedkeys("q:\", "xt")') + only + endfunc + + " Test for recursively getting multiple command line inputs + func Test_cmdwin_multi_input() + call feedkeys(":\=input('P: ')\\"cyan\\", 'xt') + call assert_equal('"cyan', @:) + endfunc + + " Test for using CTRL-_ in the command line with 'allowrevins' + func Test_cmdline_revins() + CheckNotMSWindows + CheckFeature rightleft + call feedkeys(":\"abc\\", 'xt') + call assert_equal("\"abc\", @:) + set allowrevins + call feedkeys(":\"abc\xyz\\", 'xt') + call assert_equal('"abcñèæ', @:) + set allowrevins& + endfunc + + " Test for typing UTF-8 composing characters in the command line + func Test_cmdline_composing_chars() + call feedkeys(":\"\u3046\u3099\", 'xt') + call assert_equal('"ゔ', @:) + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.0346/src/testdir/test_digraph.vim 2020-01-26 21:59:25.632718110 +0100 --- src/testdir/test_digraph.vim 2020-03-02 20:52:22.416001322 +0100 *************** *** 451,460 **** func Test_digraph_cmndline() " Create digraph on commandline ! " This is a hack, to let Vim create the digraph in commandline mode ! let s = '' ! exe "sil! norm! :let s.='\Eu'\" ! call assert_equal("€", s) endfunc func Test_show_digraph() --- 451,462 ---- func Test_digraph_cmndline() " Create digraph on commandline ! call feedkeys(":\"\Eu\", 'xt') ! call assert_equal('"€', @:) ! ! " Canceling a CTRL-K on the cmdline ! call feedkeys(":\"a\\b\", 'xt') ! call assert_equal('"ab', @:) endfunc func Test_show_digraph() *** ../vim-8.2.0346/src/testdir/test_ex_mode.vim 2020-03-01 16:53:06.378524819 +0100 --- src/testdir/test_ex_mode.vim 2020-03-02 20:52:22.416001322 +0100 *************** *** 50,56 **** 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& --- 50,60 ---- call assert_equal(['foo', ' foo0'], Ex(" foo0\"), e) call assert_equal(['foo', ' foo^'], Ex(" foo^\"), e) call assert_equal(['foo', 'foo'], ! \ Ex("\\\\foo"), e) ! " default wildchar interferes with this test ! set wildchar= ! call assert_equal(["a\tb", "a\tb"], Ex("a\t\t\b"), e) ! set wildchar& endfor set sw& *************** *** 139,142 **** --- 143,160 ---- close! endfunc + " In Ex-mode, backslashes at the end of a command should be halved. + func Test_Ex_echo_backslash() + " This test works only when the language is English + if v:lang != "C" && v:lang !~ '^[Ee]n' + return + endif + let bsl = '\\\\' + let bsl2 = '\\\' + call assert_fails('call feedkeys("Qecho " .. bsl .. "\nvisual\n", "xt")', + \ "E15: Invalid expression: \\\\") + call assert_fails('call feedkeys("Qecho " .. bsl2 .. "\nm\nvisual\n", "xt")', + \ "E15: Invalid expression: \\\nm") + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.0346/src/testdir/test_history.vim 2020-03-01 16:53:06.378524819 +0100 --- src/testdir/test_history.vim 2020-03-02 20:52:22.416001322 +0100 *************** *** 176,187 **** --- 176,227 ---- cunmap delfunc SavePat + " Search for a pattern that is not present in the history + call assert_beeps('call feedkeys("/a1b2\\", "xt")') + " Recall patterns with 'history' set to 0 set history=0 let @/ = 'abc' let cmd = 'call feedkeys("/\\\\\", "xt")' call assert_fails(cmd, 'E486:') set history& + + " Recall patterns till the end of history + set history=4 + call histadd('/', 'pat') + call histdel('/') + call histadd('/', 'pat1') + call histadd('/', 'pat2') + call assert_beeps('call feedkeys("/\\\\\", "xt")') + call assert_beeps('call feedkeys("/\", "xt")') + + " Test for wrapping around the history list + for i in range(3, 7) + call histadd('/', 'pat' .. i) + endfor + let upcmd = "\\\\\" + let downcmd = "\\\\\" + try + call feedkeys("/" .. upcmd .. "\", 'xt') + catch /E486:/ + endtry + call assert_equal('pat4', @/) + try + call feedkeys("/" .. upcmd .. downcmd .. "\", 'xt') + catch /E486:/ + endtry + call assert_equal('pat4', @/) + + " Test for changing the search command separator in the history + call assert_fails('call feedkeys("/def/\", "xt")', 'E486:') + call assert_fails('call feedkeys("?\\", "xt")', 'E486:') + call assert_equal('def?', histget('/', -1)) + + call assert_fails('call feedkeys("/ghi?\", "xt")', 'E486:') + call assert_fails('call feedkeys("?\\", "xt")', 'E486:') + call assert_equal('ghi\?', histget('/', -1)) + + set history& endfunc " Test for making sure the key value is not stored in history *** ../vim-8.2.0346/src/version.c 2020-03-01 23:32:22.348059441 +0100 --- src/version.c 2020-03-02 20:53:24.543869870 +0100 *************** *** 740,741 **** --- 740,743 ---- { /* Add new patch number below this line */ + /**/ + 347, /**/ -- hundred-and-one symptoms of being an internet addict: 167. You have more than 200 websites bookmarked. /// 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 ///