Mercurial > vim
comparison src/testdir/test_quickfix.vim @ 11412:84baca75b7f2 v8.0.0590
patch 8.0.0590: cannot add a context to locations
commit https://github.com/vim/vim/commit/8f77c5a4ec756f3f866bd6b18feb6fca6f2a2e91
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Apr 30 14:21:00 2017 +0200
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 #1012)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 30 Apr 2017 14:30:04 +0200 |
parents | 73cfcf11d983 |
children | 461ac47c3793 |
comparison
equal
deleted
inserted
replaced
11411:ab53b2f7ffc3 | 11412:84baca75b7f2 |
---|---|
1770 call assert_equal({}, g:Xgetlist({'nr':[], 'title':1})) | 1770 call assert_equal({}, g:Xgetlist({'nr':[], 'title':1})) |
1771 | 1771 |
1772 if a:cchar == 'l' | 1772 if a:cchar == 'l' |
1773 call assert_equal({}, getloclist(99, {'title': 1})) | 1773 call assert_equal({}, getloclist(99, {'title': 1})) |
1774 endif | 1774 endif |
1775 | |
1776 " Context related tests | |
1777 call g:Xsetlist([], 'a', {'context':[1,2,3]}) | |
1778 call test_garbagecollect_now() | |
1779 let d = g:Xgetlist({'context':1}) | |
1780 call assert_equal([1,2,3], d.context) | |
1781 call g:Xsetlist([], 'a', {'context':{'color':'green'}}) | |
1782 let d = g:Xgetlist({'context':1}) | |
1783 call assert_equal({'color':'green'}, d.context) | |
1784 call g:Xsetlist([], 'a', {'context':"Context info"}) | |
1785 let d = g:Xgetlist({'context':1}) | |
1786 call assert_equal("Context info", d.context) | |
1787 call g:Xsetlist([], 'a', {'context':246}) | |
1788 let d = g:Xgetlist({'context':1}) | |
1789 call assert_equal(246, d.context) | |
1790 if a:cchar == 'l' | |
1791 " Test for copying context across two different location lists | |
1792 new | only | |
1793 let w1_id = win_getid() | |
1794 let l = [1] | |
1795 call setloclist(0, [], 'a', {'context':l}) | |
1796 new | |
1797 let w2_id = win_getid() | |
1798 call add(l, 2) | |
1799 call assert_equal([1, 2], getloclist(w1_id, {'context':1}).context) | |
1800 call assert_equal([1, 2], getloclist(w2_id, {'context':1}).context) | |
1801 unlet! l | |
1802 call assert_equal([1, 2], getloclist(w2_id, {'context':1}).context) | |
1803 only | |
1804 call setloclist(0, [], 'f') | |
1805 call assert_equal({}, getloclist(0, {'context':1})) | |
1806 endif | |
1775 endfunc | 1807 endfunc |
1776 | 1808 |
1777 func Test_qf_property() | 1809 func Test_qf_property() |
1778 call Xproperty_tests('c') | 1810 call Xproperty_tests('c') |
1779 call Xproperty_tests('l') | 1811 call Xproperty_tests('l') |