From b4acf609ac2ec39260b9e42bd61fc476d36763ad Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 7 Sep 2018 22:22:37 -0400 Subject: vim-patch:8.0.1006: quickfix list changes when parsing text with 'erroformat' Problem: Cannot parse text with 'erroformat' without changing a quickfix list. Solution: Add the "text" argument to getqflist(). (Yegappan Lakshmanan) https://github.com/vim/vim/commit/7adf06f4e25c795ba32ff0b2e8591330f6a41afb --- src/nvim/testdir/test_quickfix.vim | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/nvim/testdir/test_quickfix.vim') diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim index f603f46d63..fd51fb22b4 100644 --- a/src/nvim/testdir/test_quickfix.vim +++ b/src/nvim/testdir/test_quickfix.vim @@ -2501,3 +2501,29 @@ func Test_add_qf() call XaddQf_tests('c') call XaddQf_tests('l') endfunc + +" Test for getting the quickfix list items from some text without modifying +" the quickfix stack +func XgetListFromText(cchar) + call s:setup_commands(a:cchar) + call g:Xsetlist([], 'f') + + let l = g:Xgetlist({'text' : "File1:10:Line10"}).items + call assert_equal(1, len(l)) + call assert_equal('Line10', l[0].text) + + let l = g:Xgetlist({'text' : ["File2:20:Line20", "File2:30:Line30"]}).items + call assert_equal(2, len(l)) + call assert_equal(30, l[1].lnum) + + call assert_equal({}, g:Xgetlist({'text' : 10})) + call assert_equal({}, g:Xgetlist({'text' : []})) + + " Make sure that the quickfix stack is not modified + call assert_equal(0, g:Xgetlist({'nr' : '$'}).nr) +endfunc + +func Test_get_list_from_text() + call XgetListFromText('c') + call XgetListFromText('l') +endfunc -- cgit