Mercurial > vim
diff src/testdir/test_quickfix.vim @ 12427:fc3e2d5614dd v8.0.1093
patch 8.0.1093: various small quickfix issues
commit https://github.com/vim/vim/commit/b4d5fbabc99917a8069ba32a60c2d73d4f60e128
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Sep 11 19:31:28 2017 +0200
patch 8.0.1093: various small quickfix issues
Problem: Various small quickfix issues.
Solution: Remove ":" prefix from title set by a user. Add the qf_id2nr().
function. Add a couple more tests. Update documentation.
(Yegappan Lakshmanan)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 11 Sep 2017 19:45:04 +0200 |
parents | 2779d593a706 |
children | 805f7fd40e0d |
line wrap: on
line diff
--- a/src/testdir/test_quickfix.vim +++ b/src/testdir/test_quickfix.vim @@ -487,6 +487,19 @@ func s:test_xhelpgrep(cchar) " This wipes out the buffer, make sure that doesn't cause trouble. Xclose + if a:cchar == 'l' + " When a help window is present, running :lhelpgrep should reuse the + " help window and not the current window + new | only + call g:Xsetlist([], 'f') + help index.txt + wincmd w + lhelpgrep quickfix + call assert_equal(1, winnr()) + call assert_notequal([], getloclist(1)) + call assert_equal([], getloclist(2)) + endif + new | only " Search for non existing help string @@ -1684,6 +1697,10 @@ func HistoryTest(cchar) call assert_equal(' error list 1 of 3; 1 ' . common, res[0]) call assert_equal(' error list 2 of 3; 2 ' . common, res[1]) call assert_equal('> error list 3 of 3; 3 ' . common, res[2]) + + call g:Xsetlist([], 'f') + let l = split(execute(a:cchar . 'hist'), "\n") + call assert_equal('No entries', l[0]) endfunc func Test_history() @@ -1862,6 +1879,11 @@ func Xproperty_tests(cchar) let l = g:Xgetlist({'items':1}) call assert_equal(0, len(l.items)) + call g:Xsetlist([], 'r', {'title' : 'TestTitle'}) + call g:Xsetlist([], 'r', {'items' : [{'filename' : 'F1', 'lnum' : 10, 'text' : 'L10'}]}) + call g:Xsetlist([], 'r', {'items' : [{'filename' : 'F1', 'lnum' : 10, 'text' : 'L10'}]}) + call assert_equal('TestTitle', g:Xgetlist({'title' : 1}).title) + " The following used to crash Vim with address sanitizer call g:Xsetlist([], 'f') call g:Xsetlist([], 'a', {'items' : [{'filename':'F1', 'lnum':10}]}) @@ -1904,10 +1926,10 @@ func Xproperty_tests(cchar) call g:Xsetlist([], 'r', l2) let newl1=g:Xgetlist({'nr':1,'all':1}) let newl2=g:Xgetlist({'nr':2,'all':1}) - call assert_equal(':Fruits', newl1.title) + call assert_equal('Fruits', newl1.title) call assert_equal(['Fruits'], newl1.context) call assert_equal('Line20', newl1.items[0].text) - call assert_equal(':Colors', newl2.title) + call assert_equal('Colors', newl2.title) call assert_equal(['Colors'], newl2.context) call assert_equal('Line10', newl2.items[0].text) call g:Xsetlist([], 'f')