diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-04-22 21:20:46 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-04-22 21:20:46 +0200 |
commit | f1d21c8cc83f40c815b6bf13cd2043152db533ee (patch) | |
tree | 7141447bfa2e1b01006d0edef62efeddae993b22 /src/testdir | |
parent | 9b77016545d5ef1a1f4a90c9bb4b7a6693af8918 (diff) |
patch 8.0.0580: cannot set the valid flag with setqflist()v8.0.0580
Problem: Cannot set the valid flag with setqflist().
Solution: Add the "valid" argument. (Yegappan Lakshmanan, closes #1642)
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_quickfix.vim | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim index c77f3c94c0..fa14190f3b 100644 --- a/src/testdir/test_quickfix.vim +++ b/src/testdir/test_quickfix.vim @@ -1201,6 +1201,25 @@ func SetXlistTests(cchar, bnum) let l = g:Xgetlist() call assert_equal(0, len(l)) + " Tests for setting the 'valid' flag + call g:Xsetlist([{'bufnr':a:bnum, 'lnum':4, 'valid':0}]) + Xwindow + call assert_equal(1, winnr('$')) + let l = g:Xgetlist() + call g:Xsetlist(l) + call assert_equal(0, g:Xgetlist()[0].valid) + call g:Xsetlist([{'text':'Text1', 'valid':1}]) + Xwindow + call assert_equal(2, winnr('$')) + Xclose + let save_efm = &efm + set efm=%m + Xgetexpr 'TestMessage' + let l = g:Xgetlist() + call g:Xsetlist(l) + call assert_equal(1, g:Xgetlist()[0].valid) + let &efm = save_efm + " Error cases: " Refer to a non-existing buffer and pass a non-dictionary type call assert_fails("call g:Xsetlist([{'bufnr':998, 'lnum':4}," . |