comparison src/testdir/test_quickfix.vim @ 22087:ff21e2962490 v8.2.1593

patch 8.2.1593: tests do not check the error number properly Commit: https://github.com/vim/vim/commit/e2e4075fad1326181edc5a131e48c644ef613693 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Sep 4 21:18:46 2020 +0200 patch 8.2.1593: tests do not check the error number properly Problem: Tests do not check the error number properly.0 Solution: Add a colon after the error number. (closes https://github.com/vim/vim/issues/6869)
author Bram Moolenaar <Bram@vim.org>
date Fri, 04 Sep 2020 21:30:04 +0200
parents c67a9d3b3683
children b7cc5d8ea702
comparison
equal deleted inserted replaced
22086:0fbcd63c0cc2 22087:ff21e2962490
357 call assert_true(len(l) == 2 && 357 call assert_true(len(l) == 2 &&
358 \ l[0].lnum == 700 && l[0].col == 10 && l[0].text ==# 'Line 700' && 358 \ l[0].lnum == 700 && l[0].col == 10 && l[0].text ==# 'Line 700' &&
359 \ l[1].lnum == 800 && l[1].col == 15 && l[1].text ==# 'Line 800') 359 \ l[1].lnum == 800 && l[1].col == 15 && l[1].text ==# 'Line 800')
360 360
361 " Test with a non existent file 361 " Test with a non existent file
362 call assert_fails('Xfile non_existent_file', 'E40') 362 call assert_fails('Xfile non_existent_file', 'E40:')
363 363
364 " Run cfile/lfile from a modified buffer 364 " Run cfile/lfile from a modified buffer
365 enew! 365 enew!
366 silent! put ='Quickfix' 366 silent! put ='Quickfix'
367 silent! Xfile Xqftestfile1 367 silent! Xfile Xqftestfile1
500 \ 'RegularLine1', 500 \ 'RegularLine1',
501 \ 'RegularLine2'] 501 \ 'RegularLine2']
502 502
503 Xfirst 503 Xfirst
504 call assert_fails('-5Xcc', 'E16:') 504 call assert_fails('-5Xcc', 'E16:')
505 call assert_fails('Xprev', 'E553') 505 call assert_fails('Xprev', 'E553:')
506 call assert_fails('Xpfile', 'E553') 506 call assert_fails('Xpfile', 'E553:')
507 Xnfile 507 Xnfile
508 call assert_equal('Xqftestfile2', @%) 508 call assert_equal('Xqftestfile2', @%)
509 call assert_equal(10, line('.')) 509 call assert_equal(10, line('.'))
510 Xpfile 510 Xpfile
511 call assert_equal('Xqftestfile1', @%) 511 call assert_equal('Xqftestfile1', @%)
524 call assert_equal(6, g:Xgetlist({'idx':0}).idx) 524 call assert_equal(6, g:Xgetlist({'idx':0}).idx)
525 Xlast 525 Xlast
526 Xprev 526 Xprev
527 call assert_equal('Xqftestfile2', @%) 527 call assert_equal('Xqftestfile2', @%)
528 call assert_equal(11, line('.')) 528 call assert_equal(11, line('.'))
529 call assert_fails('Xnext', 'E553') 529 call assert_fails('Xnext', 'E553:')
530 call assert_fails('Xnfile', 'E553') 530 call assert_fails('Xnfile', 'E553:')
531 " To process the range using quickfix list entries, directly use the 531 " To process the range using quickfix list entries, directly use the
532 " quickfix commands (don't use the user defined commands) 532 " quickfix commands (don't use the user defined commands)
533 if a:cchar == 'c' 533 if a:cchar == 'c'
534 $cc 534 $cc
535 else 535 else
2172 call assert_equal({'winid':win_getid()}, getqflist({'winid':1})) 2172 call assert_equal({'winid':win_getid()}, getqflist({'winid':1}))
2173 cclose 2173 cclose
2174 endif 2174 endif
2175 2175
2176 " Invalid arguments 2176 " Invalid arguments
2177 call assert_fails('call g:Xgetlist([])', 'E715') 2177 call assert_fails('call g:Xgetlist([])', 'E715:')
2178 call assert_fails('call g:Xsetlist([], "a", [])', 'E715') 2178 call assert_fails('call g:Xsetlist([], "a", [])', 'E715:')
2179 let s = g:Xsetlist([], 'a', {'abc':1}) 2179 let s = g:Xsetlist([], 'a', {'abc':1})
2180 call assert_equal(-1, s) 2180 call assert_equal(-1, s)
2181 2181
2182 call assert_equal({}, g:Xgetlist({'abc':1})) 2182 call assert_equal({}, g:Xgetlist({'abc':1}))
2183 call assert_equal('', g:Xgetlist({'nr':99, 'title':1}).title) 2183 call assert_equal('', g:Xgetlist({'nr':99, 'title':1}).title)
2976 endfunc 2976 endfunc
2977 2977
2978 func Test_cclose_from_copen() 2978 func Test_cclose_from_copen()
2979 augroup QF_Test 2979 augroup QF_Test
2980 au! 2980 au!
2981 au FileType qf :call assert_fails(':cclose', 'E788') 2981 au FileType qf :call assert_fails(':cclose', 'E788:')
2982 augroup END 2982 augroup END
2983 copen 2983 copen
2984 augroup QF_Test 2984 augroup QF_Test
2985 au! 2985 au!
2986 augroup END 2986 augroup END
2991 " Problem is only triggered if "starting" is zero, so that the OptionsSet 2991 " Problem is only triggered if "starting" is zero, so that the OptionsSet
2992 " event will be triggered. 2992 " event will be triggered.
2993 call test_override('starting', 1) 2993 call test_override('starting', 1)
2994 augroup QF_Test 2994 augroup QF_Test
2995 au! 2995 au!
2996 au FileType qf :call assert_fails(':cclose', 'E788') 2996 au FileType qf :call assert_fails(':cclose', 'E788:')
2997 augroup END 2997 augroup END
2998 copen 2998 copen
2999 augroup QF_Test 2999 augroup QF_Test
3000 au! 3000 au!
3001 augroup END 3001 augroup END
3019 cclose 3019 cclose
3020 3020
3021 " Fails with argument. 3021 " Fails with argument.
3022 augroup QF_Test 3022 augroup QF_Test
3023 au! 3023 au!
3024 au FileType qf call assert_fails(':file foo', 'E788') 3024 au FileType qf call assert_fails(':file foo', 'E788:')
3025 augroup END 3025 augroup END
3026 copen 3026 copen
3027 augroup QF_Test 3027 augroup QF_Test
3028 au! 3028 au!
3029 augroup END 3029 augroup END
3700 3700
3701 " The following test used to crash vim 3701 " The following test used to crash vim
3702 func Test_lfile_crash() 3702 func Test_lfile_crash()
3703 sp Xtest 3703 sp Xtest
3704 au QuickFixCmdPre * bw 3704 au QuickFixCmdPre * bw
3705 call assert_fails('lfile', 'E40') 3705 call assert_fails('lfile', 'E40:')
3706 au! QuickFixCmdPre 3706 au! QuickFixCmdPre
3707 endfunc 3707 endfunc
3708 3708
3709 " The following test used to crash vim 3709 " The following test used to crash vim
3710 func Test_lbuffer_crash() 3710 func Test_lbuffer_crash()
4233 4233
4234 " Test that "CTRL-W <CR>" in a qf/ll window fails with empty list. 4234 " Test that "CTRL-W <CR>" in a qf/ll window fails with empty list.
4235 call g:Xsetlist([]) 4235 call g:Xsetlist([])
4236 Xopen 4236 Xopen
4237 let l:win_count = winnr('$') 4237 let l:win_count = winnr('$')
4238 call assert_fails('execute "normal! \<C-W>\<CR>"', 'E42') 4238 call assert_fails('execute "normal! \<C-W>\<CR>"', 'E42:')
4239 call assert_equal(l:win_count, winnr('$')) 4239 call assert_equal(l:win_count, winnr('$'))
4240 Xclose 4240 Xclose
4241 endfunc 4241 endfunc
4242 4242
4243 func Test_view_result_split() 4243 func Test_view_result_split()