diff options
| author | James McCoy <jamessan@jamessan.com> | 2017-02-27 14:35:57 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-02-27 14:35:57 -0500 |
| commit | d290c1342117867d4fb1e8ffbe685037553971a5 (patch) | |
| tree | b72fbf5e641bc2558ac5f34f9bbc7f4cc57e4b27 /src/nvim/testdir | |
| parent | be65fd88f40cc0a955b25f7ef78bd954f3986046 (diff) | |
| parent | a989851e3b66cd1c14c6c674b83f302648df0b82 (diff) | |
| download | rneovim-d290c1342117867d4fb1e8ffbe685037553971a5.tar.gz rneovim-d290c1342117867d4fb1e8ffbe685037553971a5.tar.bz2 rneovim-d290c1342117867d4fb1e8ffbe685037553971a5.zip | |
Merge pull request #6188 from jamessan/vim-7.4.2200
vim-patch:7.4.2200
Closes #5314
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_quickfix.vim | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim index 7464a11abd..0d6e5e1830 100644 --- a/src/nvim/testdir/test_quickfix.vim +++ b/src/nvim/testdir/test_quickfix.vim @@ -1462,3 +1462,42 @@ func Test_duplicate_buf() call delete('Xgrepthis') endfunc + +" Quickfix/Location list set/get properties tests +function Xproperty_tests(cchar) + call s:setup_commands(a:cchar) + + " Error cases + call assert_fails('call g:Xgetlist(99)', 'E715:') + call assert_fails('call g:Xsetlist(99)', 'E714:') + call assert_fails('call g:Xsetlist([], "a", [])', 'E715:') + + " Set and get the title + Xopen + wincmd p + call g:Xsetlist([{'filename':'foo', 'lnum':27}]) + call g:Xsetlist([], 'a', {'title' : 'Sample'}) + let d = g:Xgetlist({"title":1}) + call assert_equal('Sample', d.title) + + Xopen + call assert_equal('Sample', w:quickfix_title) + Xclose + + " Invalid arguments + call assert_fails('call g:Xgetlist([])', 'E715') + call assert_fails('call g:Xsetlist([], "a", [])', 'E715') + let s = g:Xsetlist([], 'a', {'abc':1}) + call assert_equal(-1, s) + + call assert_equal({}, g:Xgetlist({'abc':1})) + + if a:cchar == 'l' + call assert_equal({}, getloclist(99, ['title'])) + endif +endfunction + +function Test_qf_property() + call Xproperty_tests('c') + call Xproperty_tests('l') +endfunction |