forked from aniani/vim
patch 9.1.0786: tests: quickfix update test does not test location list
Problem: tests: quickfix update test does not test location list (after: v9.1.0.785) Solution: update Test_quickfix_buffer_contents to test with location lists (Yegappan Lakshmanan) closes: #15879 Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
5bcfb5a30c
commit
6a1deaf5ad
@@ -6462,7 +6462,9 @@ func Test_quickfix_buffer_contents()
|
|||||||
call setqflist([], 'f')
|
call setqflist([], 'f')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_quickfix_update()
|
func XquickfixUpdateTests(cchar)
|
||||||
|
call s:setup_commands(a:cchar)
|
||||||
|
|
||||||
" Setup: populate a couple buffers
|
" Setup: populate a couple buffers
|
||||||
new
|
new
|
||||||
call setline(1, range(1, 5))
|
call setline(1, range(1, 5))
|
||||||
@@ -6472,25 +6474,32 @@ func Test_quickfix_update()
|
|||||||
let b2 = bufnr()
|
let b2 = bufnr()
|
||||||
" Setup: set a quickfix list.
|
" Setup: set a quickfix list.
|
||||||
let items = [{'bufnr': b1, 'lnum': 1}, {'bufnr': b1, 'lnum': 2}, {'bufnr': b2, 'lnum': 1}, {'bufnr': b2, 'lnum': 2}]
|
let items = [{'bufnr': b1, 'lnum': 1}, {'bufnr': b1, 'lnum': 2}, {'bufnr': b2, 'lnum': 1}, {'bufnr': b2, 'lnum': 2}]
|
||||||
call setqflist(items)
|
call g:Xsetlist(items)
|
||||||
|
|
||||||
" Open the quickfix list, select the third entry.
|
" Open the quickfix list, select the third entry.
|
||||||
copen
|
Xopen
|
||||||
exe "normal jj\<CR>"
|
exe "normal jj\<CR>"
|
||||||
call assert_equal(3, getqflist({'idx' : 0}).idx)
|
call assert_equal(3, g:Xgetlist({'idx' : 0}).idx)
|
||||||
|
|
||||||
" Update the quickfix list. Make sure the third entry is still selected.
|
" Update the quickfix list. Make sure the third entry is still selected.
|
||||||
call setqflist([], 'u', { 'items': items })
|
call g:Xsetlist([], 'u', { 'items': items })
|
||||||
call assert_equal(3, getqflist({'idx' : 0}).idx)
|
call assert_equal(3, g:Xgetlist({'idx' : 0}).idx)
|
||||||
|
|
||||||
" Update the quickfix list again, but this time with missing line number
|
" Update the quickfix list again, but this time with missing line number
|
||||||
" information. Confirm that we keep the current buffer selected.
|
" information. Confirm that we keep the current buffer selected.
|
||||||
call setqflist([{'bufnr': b1}, {'bufnr': b2}], 'u')
|
call g:Xsetlist([{'bufnr': b1}, {'bufnr': b2}], 'u')
|
||||||
call assert_equal(2, getqflist({'idx' : 0}).idx)
|
call assert_equal(2, g:Xgetlist({'idx' : 0}).idx)
|
||||||
|
|
||||||
|
Xclose
|
||||||
|
|
||||||
" Cleanup the buffers we allocated during this test.
|
" Cleanup the buffers we allocated during this test.
|
||||||
%bwipe!
|
%bwipe!
|
||||||
%bwipe!
|
endfunc
|
||||||
|
|
||||||
|
" Test for updating a quickfix list using the "u" flag in setqflist()
|
||||||
|
func Test_quickfix_update()
|
||||||
|
call XquickfixUpdateTests('c')
|
||||||
|
call XquickfixUpdateTests('l')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_quickfix_update_with_missing_coordinate_info()
|
func Test_quickfix_update_with_missing_coordinate_info()
|
||||||
|
@@ -704,6 +704,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
786,
|
||||||
/**/
|
/**/
|
||||||
785,
|
785,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user