test(old): reorder test_cmdline.vim to match upstream

This commit is contained in:
zeertzjq
2022-07-01 11:17:21 +08:00
parent 300490f2e8
commit b22f7dd908

View File

@@ -902,22 +902,6 @@ func Test_getcmdwin_autocmd()
augroup END augroup END
endfunc endfunc
" Test error: "E135: *Filter* Autocommands must not change current buffer"
func Test_cmd_bang_E135()
new
call setline(1, ['a', 'b', 'c', 'd'])
augroup test_cmd_filter_E135
au!
autocmd FilterReadPost * help
augroup END
call assert_fails('2,3!echo "x"', 'E135:')
augroup test_cmd_filter_E135
au!
augroup END
%bwipe!
endfunc
func Test_verbosefile() func Test_verbosefile()
set verbosefile=Xlog set verbosefile=Xlog
echomsg 'foo' echomsg 'foo'
@@ -998,34 +982,6 @@ func Test_cmdline_overstrike()
let &encoding = encoding_save let &encoding = encoding_save
endfunc endfunc
func Test_cmdwin_feedkeys()
" This should not generate E488
call feedkeys("q:\<CR>", 'x')
endfunc
" Tests for the issues fixed in 7.4.441.
" When 'cedit' is set to Ctrl-C, opening the command window hangs Vim
func Test_cmdwin_cedit()
exe "set cedit=\<C-c>"
normal! :
call assert_equal(1, winnr('$'))
let g:cmd_wintype = ''
func CmdWinType()
let g:cmd_wintype = getcmdwintype()
let g:wintype = win_gettype()
return ''
endfunc
call feedkeys("\<C-c>a\<C-R>=CmdWinType()\<CR>\<CR>")
echo input('')
call assert_equal('@', g:cmd_wintype)
call assert_equal('command', g:wintype)
set cedit&vim
delfunc CmdWinType
endfunc
func Test_cmdwin_restore() func Test_cmdwin_restore()
CheckScreendump CheckScreendump
@@ -1102,6 +1058,34 @@ func Test_buffers_lastused()
bwipeout bufc bwipeout bufc
endfunc endfunc
func Test_cmdwin_feedkeys()
" This should not generate E488
call feedkeys("q:\<CR>", 'x')
endfunc
" Tests for the issues fixed in 7.4.441.
" When 'cedit' is set to Ctrl-C, opening the command window hangs Vim
func Test_cmdwin_cedit()
exe "set cedit=\<C-c>"
normal! :
call assert_equal(1, winnr('$'))
let g:cmd_wintype = ''
func CmdWinType()
let g:cmd_wintype = getcmdwintype()
let g:wintype = win_gettype()
return ''
endfunc
call feedkeys("\<C-c>a\<C-R>=CmdWinType()\<CR>\<CR>")
echo input('')
call assert_equal('@', g:cmd_wintype)
call assert_equal('command', g:wintype)
set cedit&vim
delfunc CmdWinType
endfunc
" Test for CmdwinEnter autocmd " Test for CmdwinEnter autocmd
func Test_cmdwin_autocmd() func Test_cmdwin_autocmd()
CheckFeature cmdwin CheckFeature cmdwin
@@ -1152,6 +1136,22 @@ func Test_cmdwin_tabpage()
tabclose! tabclose!
endfunc endfunc
" Test error: "E135: *Filter* Autocommands must not change current buffer"
func Test_cmd_bang_E135()
new
call setline(1, ['a', 'b', 'c', 'd'])
augroup test_cmd_filter_E135
au!
autocmd FilterReadPost * help
augroup END
call assert_fails('2,3!echo "x"', 'E135:')
augroup test_cmd_filter_E135
au!
augroup END
%bwipe!
endfunc
" test that ";" works to find a match at the start of the first line " test that ";" works to find a match at the start of the first line
func Test_zero_line_search() func Test_zero_line_search()
new new