Skip to content

Commit 6a1deaf

Browse files
yegappanchrisbra
authored andcommitted
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>
1 parent 5bcfb5a commit 6a1deaf

2 files changed

Lines changed: 20 additions & 9 deletions

File tree

src/testdir/test_quickfix.vim

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6462,7 +6462,9 @@ func Test_quickfix_buffer_contents()
64626462
call setqflist([], 'f')
64636463
endfunc
64646464

6465-
func Test_quickfix_update()
6465+
func XquickfixUpdateTests(cchar)
6466+
call s:setup_commands(a:cchar)
6467+
64666468
" Setup: populate a couple buffers
64676469
new
64686470
call setline(1, range(1, 5))
@@ -6472,25 +6474,32 @@ func Test_quickfix_update()
64726474
let b2 = bufnr()
64736475
" Setup: set a quickfix list.
64746476
let items = [{'bufnr': b1, 'lnum': 1}, {'bufnr': b1, 'lnum': 2}, {'bufnr': b2, 'lnum': 1}, {'bufnr': b2, 'lnum': 2}]
6475-
call setqflist(items)
6477+
call g:Xsetlist(items)
64766478

64776479
" Open the quickfix list, select the third entry.
6478-
copen
6480+
Xopen
64796481
exe "normal jj\<CR>"
6480-
call assert_equal(3, getqflist({'idx' : 0}).idx)
6482+
call assert_equal(3, g:Xgetlist({'idx' : 0}).idx)
64816483

64826484
" Update the quickfix list. Make sure the third entry is still selected.
6483-
call setqflist([], 'u', { 'items': items })
6484-
call assert_equal(3, getqflist({'idx' : 0}).idx)
6485+
call g:Xsetlist([], 'u', { 'items': items })
6486+
call assert_equal(3, g:Xgetlist({'idx' : 0}).idx)
64856487

64866488
" Update the quickfix list again, but this time with missing line number
64876489
" information. Confirm that we keep the current buffer selected.
6488-
call setqflist([{'bufnr': b1}, {'bufnr': b2}], 'u')
6489-
call assert_equal(2, getqflist({'idx' : 0}).idx)
6490+
call g:Xsetlist([{'bufnr': b1}, {'bufnr': b2}], 'u')
6491+
call assert_equal(2, g:Xgetlist({'idx' : 0}).idx)
6492+
6493+
Xclose
64906494

64916495
" Cleanup the buffers we allocated during this test.
64926496
%bwipe!
6493-
%bwipe!
6497+
endfunc
6498+
6499+
" Test for updating a quickfix list using the "u" flag in setqflist()
6500+
func Test_quickfix_update()
6501+
call XquickfixUpdateTests('c')
6502+
call XquickfixUpdateTests('l')
64946503
endfunc
64956504

64966505
func Test_quickfix_update_with_missing_coordinate_info()

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ static char *(features[]) =
704704

705705
static int included_patches[] =
706706
{ /* Add new patch number below this line */
707+
/**/
708+
786,
707709
/**/
708710
785,
709711
/**/

0 commit comments

Comments
 (0)