diff options
Diffstat (limited to 'test/old/testdir/test_cmdline.vim')
-rw-r--r-- | test/old/testdir/test_cmdline.vim | 71 |
1 files changed, 63 insertions, 8 deletions
diff --git a/test/old/testdir/test_cmdline.vim b/test/old/testdir/test_cmdline.vim index 3f13218c5b..b8eb9a2b8b 100644 --- a/test/old/testdir/test_cmdline.vim +++ b/test/old/testdir/test_cmdline.vim @@ -431,11 +431,11 @@ func Test_highlight_completion() " A cleared group does not show up in completions. hi Anders ctermfg=green - call assert_equal(['Aardig', 'Anders'], getcompletion('A', 'highlight')) + call assert_equal(['Aardig', 'Added', 'Anders'], getcompletion('A', 'highlight')) hi clear Aardig - call assert_equal(['Anders'], getcompletion('A', 'highlight')) + call assert_equal(['Added', 'Anders'], getcompletion('A', 'highlight')) hi clear Anders - call assert_equal([], getcompletion('A', 'highlight')) + call assert_equal(['Added'], getcompletion('A', 'highlight')) endfunc func Test_getcompletion() @@ -532,6 +532,13 @@ func Test_getcompletion() let l = getcompletion('horse', 'filetype') call assert_equal([], l) + if has('keymap') + let l = getcompletion('acc', 'keymap') + call assert_true(index(l, 'accents') >= 0) + let l = getcompletion('nullkeymap', 'keymap') + call assert_equal([], l) + endif + let l = getcompletion('z', 'syntax') call assert_true(index(l, 'zimbu') >= 0) let l = getcompletion('emacs', 'syntax') @@ -672,7 +679,7 @@ func Test_getcompletion() bw Xtest\ endif - call assert_fails("call getcompletion('\\\\@!\\\\@=', 'buffer')", 'E871:') + call assert_fails("call getcompletion('\\\\@!\\\\@=', 'buffer')", 'E866:') call assert_fails('call getcompletion("", "burp")', 'E475:') call assert_fails('call getcompletion("abc", [])', 'E1174:') endfunc @@ -857,10 +864,28 @@ func Test_cmdline_remove_char() let &encoding = encoding_save endfunc -func Test_cmdline_keymap_ctrl_hat() - if !has('keymap') - return +func Test_cmdline_del_utf8() + let @s = '⒌' + call feedkeys(":\"\<C-R>s,,\<C-B>\<Right>\<Del>\<CR>", 'tx') + call assert_equal('",,', @:) + + let @s = 'a̳' + call feedkeys(":\"\<C-R>s,,\<C-B>\<Right>\<Del>\<CR>", 'tx') + call assert_equal('",,', @:) + + let @s = 'β̳' + call feedkeys(":\"\<C-R>s,,\<C-B>\<Right>\<Del>\<CR>", 'tx') + call assert_equal('",,', @:) + + if has('arabic') + let @s = 'لا' + call feedkeys(":\"\<C-R>s,,\<C-B>\<Right>\<Del>\<CR>", 'tx') + call assert_equal('",,', @:) endif +endfunc + +func Test_cmdline_keymap_ctrl_hat() + CheckFeature keymap set keymap=esperanto call feedkeys(":\"Jxauxdo \<C-^>Jxauxdo \<C-^>Jxauxdo\<CR>", 'tx') @@ -1878,7 +1903,7 @@ func Test_cmdwin_tabpage() tabclose! endfunc -func Test_cmdwin_interrupted() +func Test_cmdwin_interrupted_more_prompt() CheckScreendump " aborting the :smile output caused the cmdline window to use the current @@ -3911,4 +3936,34 @@ func Test_custom_completion_with_glob() delfunc TestGlobComplete endfunc +func Test_window_size_stays_same_after_changing_cmdheight() + set laststatus=2 + let expected = winheight(0) + function! Function_name() abort + call feedkeys(":"..repeat('x', &columns), 'x') + let &cmdheight=2 + let &cmdheight=1 + redraw + endfunction + call Function_name() + call assert_equal(expected, winheight(0)) +endfunc + +" verify that buffer-completion finds all buffer names matching a pattern +func Test_buffer_completion() + " should return empty list + call assert_equal([], getcompletion('', 'buffer')) + + call mkdir('Xbuf_complete', 'R') + e Xbuf_complete/Foobar.c + e Xbuf_complete/MyFoobar.c + e AFoobar.h + let expected = ["Xbuf_complete/Foobar.c", "Xbuf_complete/MyFoobar.c", "AFoobar.h"] + + call assert_equal(3, len(getcompletion('Foo', 'buffer'))) + call assert_equal(expected, getcompletion('Foo', 'buffer')) + call feedkeys(":b Foo\<C-A>\<C-B>\"\<CR>", 'xt') + call assert_equal("\"b Xbuf_complete/Foobar.c Xbuf_complete/MyFoobar.c AFoobar.h", @:) +endfunc + " vim: shiftwidth=2 sts=2 expandtab |