comparison src/testdir/test_mksession.vim @ 15613:90f01701ecad v8.1.0814

patch 8.1.0814: :mksession cannot handle a very long 'runtimepath' commit https://github.com/vim/vim/commit/ed18f2c03ae4786b489943cb575bb781a70356e4 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jan 24 20:30:52 2019 +0100 patch 8.1.0814: :mksession cannot handle a very long 'runtimepath' Problem: :mksession cannot handle a very long 'runtimepath'. (Timothy Madden) Solution: Expand each part separately, instead of the whole option at once. (Christian Brabandt, closes #3466)
author Bram Moolenaar <Bram@vim.org>
date Thu, 24 Jan 2019 20:45:06 +0100
parents 9da8ae285a02
children c91618229f99
comparison
equal deleted inserted replaced
15612:e08d1aa308d8 15613:90f01701ecad
1 " Test for :mksession, :mkview and :loadview in latin1 encoding 1 " Test for :mksession, :mkview and :loadview in latin1 encoding
2 2
3 set encoding=latin1 3 set encoding=latin1
4 scriptencoding latin1 4 scriptencoding latin1
5 5
6 if !has('multi_byte') || !has('mksession') 6 if !has('mksession')
7 finish 7 finish
8 endif 8 endif
9 9
10 source shared.vim 10 source shared.vim
11 11
124 set winheight& 124 set winheight&
125 source Xtest_mks_winheight.out 125 source Xtest_mks_winheight.out
126 call delete('Xtest_mks_winheight.out') 126 call delete('Xtest_mks_winheight.out')
127 endfunc 127 endfunc
128 128
129 func Test_mksession_rtp()
130 new
131 let _rtp=&rtp
132 " Make a real long (invalid) runtimepath value,
133 " that should exceed PATH_MAX (hopefully)
134 let newrtp=&rtp.',~'.repeat('/foobar', 1000)
135 let newrtp.=",".expand("$HOME")."/.vim"
136 let &rtp=newrtp
137
138 " determine expected value
139 let expected=split(&rtp, ',')
140 let expected = map(expected, '"set runtimepath+=".v:val')
141 let expected = ['set runtimepath='] + expected
142 let expected = map(expected, {v,w -> substitute(w, $HOME, "~", "g")})
143
144 mksession! Xtest_mks.out
145 let &rtp=_rtp
146 let li = filter(readfile('Xtest_mks.out'), 'v:val =~# "runtimepath"')
147 call assert_equal(expected, li)
148
149 call delete('Xtest_mks.out')
150 endfunc
151
129 func Test_mksession_arglist() 152 func Test_mksession_arglist()
130 argdel * 153 argdel *
131 next file1 file2 file3 file4 154 next file1 file2 file3 file4
132 mksession! Xtest_mks.out 155 mksession! Xtest_mks.out
133 source Xtest_mks.out 156 source Xtest_mks.out