Mercurial > vim
diff src/testdir/test_cmdline.vim @ 19581:848dc460adf0 v8.2.0347
patch 8.2.0347: various code not covered by tests
Commit: https://github.com/vim/vim/commit/91ffc8a5f5c7b1c6979b3352a12ed779d11173a9
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Mar 2 20:54:22 2020 +0100
patch 8.2.0347: various code not covered by tests
Problem: Various code not covered by tests.
Solution: Add more test coverage. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5720)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 02 Mar 2020 21:00:04 +0100 |
parents | 43c04edcafec |
children | 9c15be376631 |
line wrap: on
line diff
--- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -477,12 +477,22 @@ func Test_cmdline_paste() call feedkeys(":\"one\<C-R>\<C-X>two\<CR>", 'xt') call assert_equal('"onetwo', @:) + " Test for pasting register containing CTRL-H using CTRL-R and CTRL-R CTRL-R let @a = "xy\<C-H>z" call feedkeys(":\"\<C-R>a\<CR>", 'xt') call assert_equal('"xz', @:) + call feedkeys(":\"\<C-R>\<C-R>a\<CR>", 'xt') + call assert_equal("\"xy\<C-H>z", @:) call feedkeys(":\"\<C-R>\<C-O>a\<CR>", 'xt') call assert_equal("\"xy\<C-H>z", @:) + " Test for pasting register containing CTRL-V using CTRL-R and CTRL-R CTRL-R + let @a = "xy\<C-V>z" + call feedkeys(":\"\<C-R>=@a\<CR>\<cr>", 'xt') + call assert_equal('"xyz', @:) + call feedkeys(":\"\<C-R>\<C-R>=@a\<CR>\<cr>", 'xt') + call assert_equal("\"xy\<C-V>z", @:) + call assert_beeps('call feedkeys(":\<C-R>=\<C-R>=\<Esc>", "xt")') bwipe! @@ -1188,7 +1198,7 @@ endfunc func Test_cmdline_edit() let str = ":one two\<C-U>" let str ..= "one two\<C-W>\<C-W>" - let str ..= "one\<BS>\<C-H>\<Del>" + let str ..= "four\<BS>\<C-H>\<Del>\<kDel>" let str ..= "\<Left>five\<Right>" let str ..= "\<Home>two " let str ..= "\<C-Left>one " @@ -1207,7 +1217,7 @@ func Test_cmdline_edit_rightleft() set rightleftcmd=search let str = "/one two\<C-U>" let str ..= "one two\<C-W>\<C-W>" - let str ..= "one\<BS>\<C-H>\<Del>" + let str ..= "four\<BS>\<C-H>\<Del>\<kDel>" let str ..= "\<Right>five\<Left>" let str ..= "\<Home>two " let str ..= "\<C-Right>one " @@ -1268,4 +1278,42 @@ func Test_cmdline_inputmethod() %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:\<CR>", "xt")') + only +endfunc + +" Test for recursively getting multiple command line inputs +func Test_cmdwin_multi_input() + call feedkeys(":\<C-R>=input('P: ')\<CR>\"cyan\<CR>\<CR>", '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\<c-_>\<cr>", 'xt') + call assert_equal("\"abc\<c-_>", @:) + set allowrevins + call feedkeys(":\"abc\<c-_>xyz\<c-_>\<CR>", '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(":\"\<C-V>u3046\<C-V>u3099\<CR>", 'xt') + call assert_equal('"ゔ', @:) +endfunc + " vim: shiftwidth=2 sts=2 expandtab