diff options
author | James McCoy <jamessan@jamessan.com> | 2016-12-12 15:05:24 -0500 |
---|---|---|
committer | James McCoy <jamessan@jamessan.com> | 2016-12-27 14:10:26 -0500 |
commit | fbcc854d49330aff7e4511eb6321487f7b4fdae4 (patch) | |
tree | 3f155a97fb43e597b8a0a70282e68164f7bf0ca1 | |
parent | ab43303df7f09d1789a70e2536552461657f08ac (diff) | |
download | rneovim-fbcc854d49330aff7e4511eb6321487f7b4fdae4.tar.gz rneovim-fbcc854d49330aff7e4511eb6321487f7b4fdae4.tar.bz2 rneovim-fbcc854d49330aff7e4511eb6321487f7b4fdae4.zip |
vim-patch:7.4.1912
Problem: No test for using setqflist() on an older quickfix list.
Solution: Add a couple of tests.
https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
-rw-r--r-- | src/nvim/testdir/test_quickfix.vim | 43 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
2 files changed, 44 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim index 73ee240c77..a7ca42e021 100644 --- a/src/nvim/testdir/test_quickfix.vim +++ b/src/nvim/testdir/test_quickfix.vim @@ -734,9 +734,52 @@ function Test_setqflist() call SetXlistTests('c', bnum) call SetXlistTests('l', bnum) + enew! call delete('Xtestfile') endfunction +func Test_setqflist_empty_middle() + " create three quickfix lists + vimgrep Test_ test_quickfix.vim + let testlen = len(getqflist()) + call assert_true(testlen > 0) + vimgrep empty test_quickfix.vim + call assert_true(len(getqflist()) > 0) + vimgrep matches test_quickfix.vim + let matchlen = len(getqflist()) + call assert_true(matchlen > 0) + colder + " make the middle list empty + call setqflist([], 'r') + call assert_true(len(getqflist()) == 0) + colder + call assert_equal(testlen, len(getqflist())) + cnewer + cnewer + call assert_equal(matchlen, len(getqflist())) +endfunc + +func Test_setqflist_empty_older() + " create three quickfix lists + vimgrep one test_quickfix.vim + let onelen = len(getqflist()) + call assert_true(onelen > 0) + vimgrep two test_quickfix.vim + let twolen = len(getqflist()) + call assert_true(twolen > 0) + vimgrep three test_quickfix.vim + let threelen = len(getqflist()) + call assert_true(threelen > 0) + colder 2 + " make the first list empty, check the others didn't change + call setqflist([], 'r') + call assert_true(len(getqflist()) == 0) + cnewer + call assert_equal(twolen, len(getqflist())) + cnewer + call assert_equal(threelen, len(getqflist())) +endfunc + function! XquickfixSetListWithAct(cchar) let Xolder = a:cchar . 'older' let Xnewer = a:cchar . 'newer' diff --git a/src/nvim/version.c b/src/nvim/version.c index bf0baa8dbf..4ecf7b2dd3 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -528,7 +528,7 @@ static int included_patches[] = { // 1915 NA // 1914, 1913, - // 1912, + 1912, // 1911, // 1910, 1909, |