comparison src/testdir/test_quickfix.vim @ 13760:aef8ba129a4f v8.0.1752

patch 8.0.1752: qf_set_properties() is to long commit https://github.com/vim/vim/commit/a2aa8a2b22de909619d7faa3ff5383a6224defc5 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Apr 24 13:55:00 2018 +0200 patch 8.0.1752: qf_set_properties() is to long Problem: qf_set_properties() is to long. Solution: Refactor the function. Define INVALID_QFIDX. (Yegappan Lakshmanan, closes #2812)
author Christian Brabandt <cb@256bit.org>
date Tue, 24 Apr 2018 14:00:07 +0200
parents c38f29387245
children 7bba231fdddc
comparison
equal deleted inserted replaced
13759:1cd810ca3658 13760:aef8ba129a4f
1793 call g:Xsetlist([{'filename':'foo', 'lnum':27}]) 1793 call g:Xsetlist([{'filename':'foo', 'lnum':27}])
1794 let s = g:Xsetlist([], 'a', {'title' : 'Sample'}) 1794 let s = g:Xsetlist([], 'a', {'title' : 'Sample'})
1795 call assert_equal(0, s) 1795 call assert_equal(0, s)
1796 let d = g:Xgetlist({"title":1}) 1796 let d = g:Xgetlist({"title":1})
1797 call assert_equal('Sample', d.title) 1797 call assert_equal('Sample', d.title)
1798 " Try setting title to a non-string value
1799 call assert_equal(-1, g:Xsetlist([], 'a', {'title' : ['Test']}))
1800 call assert_equal('Sample', g:Xgetlist({"title":1}).title)
1798 1801
1799 Xopen 1802 Xopen
1800 call assert_equal('Sample', w:quickfix_title) 1803 call assert_equal('Sample', w:quickfix_title)
1801 Xclose 1804 Xclose
1802 1805
1941 " The following used to crash Vim with address sanitizer 1944 " The following used to crash Vim with address sanitizer
1942 call g:Xsetlist([], 'f') 1945 call g:Xsetlist([], 'f')
1943 call g:Xsetlist([], 'a', {'items' : [{'filename':'F1', 'lnum':10}]}) 1946 call g:Xsetlist([], 'a', {'items' : [{'filename':'F1', 'lnum':10}]})
1944 call assert_equal(10, g:Xgetlist({'items':1}).items[0].lnum) 1947 call assert_equal(10, g:Xgetlist({'items':1}).items[0].lnum)
1945 1948
1949 " Try setting the items using a string
1950 call assert_equal(-1, g:Xsetlist([], ' ', {'items' : 'Test'}))
1951
1946 " Save and restore the quickfix stack 1952 " Save and restore the quickfix stack
1947 call g:Xsetlist([], 'f') 1953 call g:Xsetlist([], 'f')
1948 call assert_equal(0, g:Xgetlist({'nr':'$'}).nr) 1954 call assert_equal(0, g:Xgetlist({'nr':'$'}).nr)
1949 Xexpr "File1:10:Line1" 1955 Xexpr "File1:10:Line1"
1950 Xexpr "File2:20:Line2" 1956 Xexpr "File2:20:Line2"