diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-06-11 16:07:51 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-06-11 16:07:51 +0200 |
commit | 875feea6ce223462d55543735143d747dcaf4287 (patch) | |
tree | a0b7be972c7799ba4e49b61ef999d3d5df4e3abc /src/testdir/test_quickfix.vim | |
parent | 60964f68740b8abcbb2d3f0f3aeade21d1bacb22 (diff) | |
download | vim-git-875feea6ce223462d55543735143d747dcaf4287.tar.gz |
patch 8.0.0634: cannot easily get to the last quickfix listv8.0.0634
Problem: Cannot easily get to the last quickfix list.
Solution: Add "$" as a value for the "nr" argument of getqflist() and
setqflist(). (Yegappan Lakshmanan)
Diffstat (limited to 'src/testdir/test_quickfix.vim')
-rw-r--r-- | src/testdir/test_quickfix.vim | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim index 51f6a6f7c..16187be76 100644 --- a/src/testdir/test_quickfix.vim +++ b/src/testdir/test_quickfix.vim @@ -1650,12 +1650,12 @@ func XbottomTests(cchar) call assert_fails('lbottom', 'E776:') endif - call g:Xsetlist([{'filename': 'foo', 'lnum': 42}]) + call g:Xsetlist([{'filename': 'foo', 'lnum': 42}]) Xopen let wid = win_getid() call assert_equal(1, line('.')) wincmd w - call g:Xsetlist([{'filename': 'var', 'lnum': 24}], 'a') + call g:Xsetlist([{'filename': 'var', 'lnum': 24}], 'a') Xbottom call win_gotoid(wid) call assert_equal(2, line('.')) @@ -2120,3 +2120,43 @@ func Test_bufoverflow() set efm&vim endfunc +func Test_cclose_from_copen() + augroup QF_Test + au! + au FileType qf :cclose + augroup END + copen + augroup QF_Test + au! + augroup END + augroup! QF_Test +endfunc + +" Tests for getting the quickfix stack size +func XsizeTests(cchar) + call s:setup_commands(a:cchar) + + call g:Xsetlist([], 'f') + call assert_equal(0, g:Xgetlist({'nr':'$'}).nr) + call assert_equal(1, len(g:Xgetlist({'nr':'$', 'all':1}))) + call assert_equal(0, len(g:Xgetlist({'nr':0}))) + + Xexpr "File1:10:Line1" + Xexpr "File2:20:Line2" + Xexpr "File3:30:Line3" + Xolder | Xolder + call assert_equal(3, g:Xgetlist({'nr':'$'}).nr) + call g:Xsetlist([], 'f') + + Xexpr "File1:10:Line1" + Xexpr "File2:20:Line2" + Xexpr "File3:30:Line3" + Xolder | Xolder + call g:Xsetlist([], 'a', {'nr':'$', 'title':'Compiler'}) + call assert_equal('Compiler', g:Xgetlist({'nr':3, 'all':1}).title) +endfunc + +func Test_Qf_Size() + call XsizeTests('c') + call XsizeTests('l') +endfunc |