Mercurial > vim
diff src/testdir/test_quickfix.vim @ 10237:197795e3530d v8.0.0017
commit https://github.com/vim/vim/commit/890680ca6364386fabb271c85e0755bcaa6a33c1
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Sep 27 21:28:56 2016 +0200
patch 8.0.0017
Problem: Cannot get the number of the current quickfix or location list.
Solution: Use the current list if "nr" in "what" is zero. (Yegappan
Lakshmanan) Remove debug command from test.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 27 Sep 2016 21:30:04 +0200 |
parents | 21f685af3fc1 |
children | 2d0e6034743a |
line wrap: on
line diff
--- a/src/testdir/test_quickfix.vim +++ b/src/testdir/test_quickfix.vim @@ -1429,12 +1429,10 @@ function! Test_two_windows() laddexpr 'one.txt:3:one one one' let loc_one = getloclist(one_id) -echo string(loc_one) call assert_equal('Xone/a/one.txt', bufname(loc_one[1].bufnr)) call assert_equal(3, loc_one[1].lnum) let loc_two = getloclist(two_id) -echo string(loc_two) call assert_equal('Xtwo/a/two.txt', bufname(loc_two[1].bufnr)) call assert_equal(5, loc_two[1].lnum) @@ -1534,6 +1532,11 @@ function Xproperty_tests(cchar) call assert_equal('N1', g:Xgetlist({'all':1}).title) call g:Xsetlist([], ' ', {'title' : 'N2'}) call assert_equal(qfnr + 1, g:Xgetlist({'all':1}).nr) + + let res = g:Xgetlist({'nr': 0}) + call assert_equal(qfnr + 1, res.nr) + call assert_equal(['nr'], keys(res)) + call g:Xsetlist([], ' ', {'title' : 'N3'}) call assert_equal('N2', g:Xgetlist({'nr':2, 'title':1}).title) @@ -1546,7 +1549,7 @@ function Xproperty_tests(cchar) call assert_equal({}, g:Xgetlist({'abc':1})) if a:cchar == 'l' - call assert_equal({}, getloclist(99, ['title'])) + call assert_equal({}, getloclist(99, {'title': 1})) endif endfunction