vim-patch:8.2.1803: a few failures are not tested

Problem:    A few failures are not tested.
Solution:   Test a few failures. (Dominique Pellé, closes vim/vim#7075)
afe8cf6170

Cherry-pick a line in Test_argdelete() from patch 8.2.1736.
This commit is contained in:
zeertzjq
2022-08-15 20:51:18 +08:00
parent cbb2e634c9
commit 535e423a6a
3 changed files with 13 additions and 2 deletions

View File

@@ -420,6 +420,8 @@ func Test_argdelete()
call assert_equal(['b'], argv()) call assert_equal(['b'], argv())
call assert_fails('argdelete', 'E610:') call assert_fails('argdelete', 'E610:')
call assert_fails('1,100argdelete', 'E16:') call assert_fails('1,100argdelete', 'E16:')
call assert_fails('argdel /\)/', 'E55:')
call assert_fails('1argdel 1', 'E474:')
call Reset_arglist() call Reset_arglist()
args a b c d args a b c d
@@ -472,13 +474,16 @@ func Test_arglist_autocmd()
new new
" redefine arglist; go to Xxx1 " redefine arglist; go to Xxx1
next! Xxx1 Xxx2 Xxx3 next! Xxx1 Xxx2 Xxx3
" open window for all args " open window for all args; Reading Xxx2 will change the arglist and the
" third window will get Xxx1:
" win 1: Xxx1
" win 2: Xxx2
" win 3: Xxx1
all all
call assert_equal('test file Xxx1', getline(1)) call assert_equal('test file Xxx1', getline(1))
wincmd w wincmd w
wincmd w wincmd w
call assert_equal('test file Xxx1', getline(1)) call assert_equal('test file Xxx1', getline(1))
" should now be in Xxx2
rewind rewind
call assert_equal('test file Xxx2', getline(1)) call assert_equal('test file Xxx2', getline(1))

View File

@@ -912,6 +912,10 @@ func Test_cmdline_complete_various()
call feedkeys(":doautocmd User MyCmd a.c\<C-A>\<C-B>\"\<CR>", 'xt') call feedkeys(":doautocmd User MyCmd a.c\<C-A>\<C-B>\"\<CR>", 'xt')
call assert_equal("\"doautocmd User MyCmd a.c\<C-A>", @:) call assert_equal("\"doautocmd User MyCmd a.c\<C-A>", @:)
" completion of autocmd group after comma
call feedkeys(":doautocmd BufNew,BufEn\<C-A>\<C-B>\"\<CR>", 'xt')
call assert_equal("\"doautocmd BufNew,BufEnter", @:)
" completion for the :augroup command " completion for the :augroup command
augroup XTest augroup XTest
augroup END augroup END

View File

@@ -649,6 +649,8 @@ func Test_reduce()
call assert_fails("call reduce({}, { acc, val -> acc + val }, 1)", 'E897:') call assert_fails("call reduce({}, { acc, val -> acc + val }, 1)", 'E897:')
call assert_fails("call reduce(0, { acc, val -> acc + val }, 1)", 'E897:') call assert_fails("call reduce(0, { acc, val -> acc + val }, 1)", 'E897:')
call assert_fails("call reduce('', { acc, val -> acc + val }, 1)", 'E897:') call assert_fails("call reduce('', { acc, val -> acc + val }, 1)", 'E897:')
call assert_fails("call reduce([1, 2], 'Xdoes_not_exist')", 'E117:')
call assert_fails("echo reduce(0z01, { acc, val -> 2 * acc + val }, '')", 'E39:')
let g:lut = [1, 2, 3, 4] let g:lut = [1, 2, 3, 4]
func EvilRemove() func EvilRemove()