diff src/testdir/test_quickfix.vim @ 12465:805f7fd40e0d v8.0.1112

patch 8.0.1112: can't get size or current index from quickfix list commit https://github.com/vim/vim/commit/fc2b270cfd36230166df486aae4d96d9d1f32755 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Sep 15 22:43:07 2017 +0200 patch 8.0.1112: can't get size or current index from quickfix list Problem: Can't get size or current index from quickfix list. Solution: Add "idx" and "size" options. (Yegappan Lakshmanan)
author Christian Brabandt <cb@256bit.org>
date Fri, 15 Sep 2017 22:45:04 +0200
parents fc3e2d5614dd
children 03a6aeea2096
line wrap: on
line diff
--- a/src/testdir/test_quickfix.vim
+++ b/src/testdir/test_quickfix.vim
@@ -430,6 +430,19 @@ func Xtest_browse(cchar)
 
   call delete('Xqftestfile1')
   call delete('Xqftestfile2')
+
+  " Should be able to use next/prev with invalid entries
+  Xexpr ""
+  call assert_equal(0, g:Xgetlist({'idx' : 0}).idx)
+  call assert_equal(0, g:Xgetlist({'size' : 0}).size)
+  Xaddexpr ['foo', 'bar', 'baz', 'quux', 'shmoo']
+  call assert_equal(5, g:Xgetlist({'size' : 0}).size)
+  Xlast
+  call assert_equal(5, g:Xgetlist({'idx' : 0}).idx)
+  Xfirst
+  call assert_equal(1, g:Xgetlist({'idx' : 0}).idx)
+  2Xnext
+  call assert_equal(3, g:Xgetlist({'idx' : 0}).idx)
 endfunc
 
 func Test_browse()