Patch 8.1.2360
Problem:    Quickfix test coverage can still be improved.
Solution:   Add more test cases. (Yegappan Lakshmanan, closes #5276)
Files:      src/testdir/test_quickfix.vim


*** ../vim-8.1.2359/src/testdir/test_quickfix.vim       2019-11-29 
20:26:09.179592194 +0100
--- src/testdir/test_quickfix.vim       2019-11-29 22:05:42.049859740 +0100
***************
*** 270,275 ****
--- 270,278 ----
        \ winheight('.') == 7 &&
        \ getline('.') ==# '|| non-error 1')
  
+   " :cnext in quickfix window should move to the next entry
+   Xnext
+   call assert_equal(2, g:Xgetlist({'idx' : 0}).idx)
  
    " Calling cwindow should close the quickfix window with no valid errors
    Xwindow
***************
*** 456,471 ****
    " result in failure
    if a:cchar == 'c'
      let err = 'E42:'
    else
      let err = 'E776:'
    endif
    call assert_fails('Xnext', err)
    call assert_fails('Xprev', err)
    call assert_fails('Xnfile', err)
    call assert_fails('Xpfile', err)
  
    Xexpr ''
-   let cmd = (a:cchar == 'c') ? '$cc' : '$ll'
    call assert_fails(cmd, 'E42:')
  
    call s:create_test_file('Xqftestfile1')
--- 459,476 ----
    " result in failure
    if a:cchar == 'c'
      let err = 'E42:'
+     let cmd = '$cc'
    else
      let err = 'E776:'
+     let cmd = '$ll'
    endif
    call assert_fails('Xnext', err)
    call assert_fails('Xprev', err)
    call assert_fails('Xnfile', err)
    call assert_fails('Xpfile', err)
+   call assert_fails(cmd, err)
  
    Xexpr ''
    call assert_fails(cmd, 'E42:')
  
    call s:create_test_file('Xqftestfile1')
***************
*** 1886,1904 ****
    enew! | only
    set makeef&vim
    silent Xgrep Grep_Test_Text: test_quickfix.vim
!   call assert_true(len(g:Xgetlist()) == 4)
    Xopen
    call assert_true(w:quickfix_title =~ '^:grep')
    Xclose
    enew
    set makeef=Temp_File_##
    silent Xgrepadd GrepAdd_Test_Text: test_quickfix.vim
!   call assert_true(len(g:Xgetlist()) == 7)
  
    call writefile(['Vim'], 'XtestTempFile')
    set makeef=XtestTempFile
    silent Xgrep Grep_Test_Text: test_quickfix.vim
!   call assert_equal(4, len(g:Xgetlist()))
    call assert_false(filereadable('XtestTempFile'))
    set makeef&vim
  endfunc
--- 1891,1916 ----
    enew! | only
    set makeef&vim
    silent Xgrep Grep_Test_Text: test_quickfix.vim
!   call assert_true(len(g:Xgetlist()) == 5)
    Xopen
    call assert_true(w:quickfix_title =~ '^:grep')
    Xclose
    enew
    set makeef=Temp_File_##
    silent Xgrepadd GrepAdd_Test_Text: test_quickfix.vim
!   call assert_true(len(g:Xgetlist()) == 9)
! 
!   " Try with 'grepprg' set to 'internal'
!   set grepprg=internal
!   silent Xgrep Grep_Test_Text: test_quickfix.vim
!   silent Xgrepadd GrepAdd_Test_Text: test_quickfix.vim
!   call assert_true(len(g:Xgetlist()) == 9)
!   set grepprg&vim
  
    call writefile(['Vim'], 'XtestTempFile')
    set makeef=XtestTempFile
    silent Xgrep Grep_Test_Text: test_quickfix.vim
!   call assert_equal(5, len(g:Xgetlist()))
    call assert_false(filereadable('XtestTempFile'))
    set makeef&vim
  endfunc
***************
*** 2458,2463 ****
--- 2470,2481 ----
      silent grepadd GrepAdd_Autocmd_Text test_quickfix.vim
      silent grep abc123def Xtest
      silent grepadd abc123def Xtest
+     set grepprg=internal
+     silent grep Grep_Autocmd_Text test_quickfix.vim
+     silent grepadd GrepAdd_Autocmd_Text test_quickfix.vim
+     silent lgrep Grep_Autocmd_Text test_quickfix.vim
+     silent lgrepadd GrepAdd_Autocmd_Text test_quickfix.vim
+     set grepprg&vim
      let l = ['pregrep',
                \ 'postgrep',
                \ 'pregrepadd',
***************
*** 2465,2471 ****
                \ 'pregrep',
                \ 'postgrep',
                \ 'pregrepadd',
!               \ 'postgrepadd']
      call assert_equal(l, g:acmds)
    endif
  
--- 2483,2497 ----
                \ 'pregrep',
                \ 'postgrep',
                \ 'pregrepadd',
!               \ 'postgrepadd',
!               \ 'pregrep',
!               \ 'postgrep',
!               \ 'pregrepadd',
!               \ 'postgrepadd',
!               \ 'prelgrep',
!               \ 'postlgrep',
!               \ 'prelgrepadd',
!               \ 'postlgrepadd']
      call assert_equal(l, g:acmds)
    endif
  
***************
*** 2603,2608 ****
--- 2629,2647 ----
    call assert_equal('quickfix', getwinvar(1, '&buftype'))
    call assert_equal('quickfix', getwinvar(3, '&buftype'))
  
+   " Jumping to a file from the location list window should find a usuable
+   " window by wrapping around the window list.
+   enew | only
+   call setloclist(0, [], 'f')
+   new | new
+   lgetexpr ["F1%10%Line 10", "F2%20%Line 20", "F3%30%Line 30"]
+   lopen
+   1close
+   call assert_equal(0, getloclist(3, {'id' : 0}).id)
+   lnext
+   call assert_equal(3, winnr())
+   call assert_equal(getloclist(1, {'id' : 0}).id, getloclist(3, {'id' : 
0}).id)
+ 
    enew | only
    set efm&vim
  endfunc
*** ../vim-8.1.2359/src/version.c       2019-11-29 21:07:55.108371775 +0100
--- src/version.c       2019-11-29 22:05:03.174041086 +0100
***************
*** 739,740 ****
--- 739,742 ----
  {   /* Add new patch number below this line */
+ /**/
+     2360,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
141. You'd rather go to http://www.weather.com/ than look out your window.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/201911292107.xATL7GsY012738%40masaka.moolenaar.net.

Raspunde prin e-mail lui