aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJan Edmund Lazo <janedmundlazo@hotmail.com>2018-09-07 22:22:37 -0400
committerJan Edmund Lazo <janedmundlazo@hotmail.com>2018-09-07 22:59:12 -0400
commitb4acf609ac2ec39260b9e42bd61fc476d36763ad (patch)
tree5e5c530e76e30486e47a0fe2c870481187847cb0 /src/nvim/testdir
parent50eadfe2e991a0bb5fe0f98377d91702f0a20492 (diff)
downloadrneovim-b4acf609ac2ec39260b9e42bd61fc476d36763ad.tar.gz
rneovim-b4acf609ac2ec39260b9e42bd61fc476d36763ad.tar.bz2
rneovim-b4acf609ac2ec39260b9e42bd61fc476d36763ad.zip
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
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_quickfix.vim26
1 files changed, 26 insertions, 0 deletions
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