aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2017-02-27 09:52:03 -0500
committerJames McCoy <jamessan@jamessan.com>2017-02-27 11:39:41 -0500
commitc9c3f92b49780e6c000afc6c17a817505d6f56ed (patch)
tree52d40721d3bf5c3c48eea74a62182800d1b2839a /src/nvim/testdir
parentbe65fd88f40cc0a955b25f7ef78bd954f3986046 (diff)
downloadrneovim-c9c3f92b49780e6c000afc6c17a817505d6f56ed.tar.gz
rneovim-c9c3f92b49780e6c000afc6c17a817505d6f56ed.tar.bz2
rneovim-c9c3f92b49780e6c000afc6c17a817505d6f56ed.zip
vim-patch:7.4.2200
Problem: Cannot get all information about a quickfix list. Solution: Add an optional argument to get/set loc/qf list(). (Yegappan Lakshmanan) https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_quickfix.vim39
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