diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-09-27 21:28:56 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-09-27 21:28:56 +0200 |
commit | 890680ca6364386fabb271c85e0755bcaa6a33c1 (patch) | |
tree | 49558541a956ccef2abd6144a5f4293d401a8929 /src/testdir/test_quickfix.vim | |
parent | 0e77b7691ee7c477facb4c9d9162c8603ada2d84 (diff) | |
download | vim-git-890680ca6364386fabb271c85e0755bcaa6a33c1.tar.gz |
patch 8.0.0017v8.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.
Diffstat (limited to 'src/testdir/test_quickfix.vim')
-rw-r--r-- | src/testdir/test_quickfix.vim | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim index affd8e633..4a39ac439 100644 --- 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 |