diff options
| author | James McCoy <jamessan@jamessan.com> | 2017-12-19 08:39:09 -0500 |
|---|---|---|
| committer | James McCoy <jamessan@jamessan.com> | 2017-12-19 14:07:24 -0500 |
| commit | 20708a07bfc1de2c56657123c41bb52919a728d8 (patch) | |
| tree | 837ab6e11270171f8046e42b83117efdb767e19c /src/nvim/testdir | |
| parent | 53a530b2f54e69adb52d32718edf36df7c0b1b5b (diff) | |
| download | rneovim-20708a07bfc1de2c56657123c41bb52919a728d8.tar.gz rneovim-20708a07bfc1de2c56657123c41bb52919a728d8.tar.bz2 rneovim-20708a07bfc1de2c56657123c41bb52919a728d8.zip | |
vim-patch:8.0.0590: cannot add a context to locations
Problem: Cannot add a context to locations.
Solution: Add the "context" entry in location entries. (Yegappan Lakshmanan,
closes vim/vim#1012)
https://github.com/vim/vim/commit/8f77c5a4ec756f3f866bd6b18feb6fca6f2a2e91
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_quickfix.vim | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim index dd64e37ce3..1d17da31ed 100644 --- a/src/nvim/testdir/test_quickfix.vim +++ b/src/nvim/testdir/test_quickfix.vim @@ -1754,6 +1754,38 @@ func Xproperty_tests(cchar) if a:cchar == 'l' call assert_equal({}, getloclist(99, {'title': 1})) endif + + " Context related tests + call g:Xsetlist([], 'a', {'context':[1,2,3]}) + call test_garbagecollect_now() + let d = g:Xgetlist({'context':1}) + call assert_equal([1,2,3], d.context) + call g:Xsetlist([], 'a', {'context':{'color':'green'}}) + let d = g:Xgetlist({'context':1}) + call assert_equal({'color':'green'}, d.context) + call g:Xsetlist([], 'a', {'context':"Context info"}) + let d = g:Xgetlist({'context':1}) + call assert_equal("Context info", d.context) + call g:Xsetlist([], 'a', {'context':246}) + let d = g:Xgetlist({'context':1}) + call assert_equal(246, d.context) + if a:cchar == 'l' + " Test for copying context across two different location lists + new | only + let w1_id = win_getid() + let l = [1] + call setloclist(0, [], 'a', {'context':l}) + new + let w2_id = win_getid() + call add(l, 2) + call assert_equal([1, 2], getloclist(w1_id, {'context':1}).context) + call assert_equal([1, 2], getloclist(w2_id, {'context':1}).context) + unlet! l + call assert_equal([1, 2], getloclist(w2_id, {'context':1}).context) + only + call setloclist(0, [], 'f') + call assert_equal({}, getloclist(0, {'context':1})) + endif endfunc func Test_qf_property() |