blob: b5583ae73ab96f8694a49952cc2deb4f7d8dec45 [file] [log] [blame]
Bram Moolenaarf3654822016-03-04 22:12:23 +01001" Tests for 'packpath' and :packadd
Bram Moolenaar863c1a92016-03-03 15:47:06 +01002
Bram Moolenaar6d91bcb2020-08-12 18:50:36 +02003source check.vim
Bram Moolenaarc3c766e2017-03-08 22:55:19 +01004
Bram Moolenaar91715872016-03-03 17:13:03 +01005func SetUp()
Bram Moolenaar3b0d70f2022-08-29 22:31:20 +01006 let s:topdir = getcwd() . '/Xppdir'
Bram Moolenaar91715872016-03-03 17:13:03 +01007 exe 'set packpath=' . s:topdir
8 let s:plugdir = s:topdir . '/pack/mine/opt/mytest'
9endfunc
10
11func TearDown()
12 call delete(s:topdir, 'rf')
13endfunc
14
Bram Moolenaarf3654822016-03-04 22:12:23 +010015func Test_packadd()
Bram Moolenaar99396d42018-09-08 18:21:16 +020016 if !exists('s:plugdir')
17 echomsg 'when running this test manually, call SetUp() first'
18 return
19 endif
20
Bram Moolenaar71fb0c12016-04-02 22:44:16 +020021 call mkdir(s:plugdir . '/plugin/also', 'p')
Bram Moolenaar91715872016-03-03 17:13:03 +010022 call mkdir(s:plugdir . '/ftdetect', 'p')
Bram Moolenaara5702442016-05-24 19:37:29 +020023 call mkdir(s:plugdir . '/after', 'p')
Bram Moolenaar91715872016-03-03 17:13:03 +010024 set rtp&
25 let rtp = &rtp
Bram Moolenaar863c1a92016-03-03 15:47:06 +010026 filetype on
Bram Moolenaar863c1a92016-03-03 15:47:06 +010027
Bram Moolenaar99396d42018-09-08 18:21:16 +020028 let rtp_entries = split(rtp, ',')
29 for entry in rtp_entries
30 if entry =~? '\<after\>'
31 let first_after_entry = entry
32 break
33 endif
34 endfor
35
Bram Moolenaar91715872016-03-03 17:13:03 +010036 exe 'split ' . s:plugdir . '/plugin/test.vim'
37 call setline(1, 'let g:plugin_works = 42')
38 wq
Bram Moolenaar863c1a92016-03-03 15:47:06 +010039
Bram Moolenaar71fb0c12016-04-02 22:44:16 +020040 exe 'split ' . s:plugdir . '/plugin/also/loaded.vim'
41 call setline(1, 'let g:plugin_also_works = 77')
42 wq
43
Bram Moolenaar91715872016-03-03 17:13:03 +010044 exe 'split ' . s:plugdir . '/ftdetect/test.vim'
45 call setline(1, 'let g:ftdetect_works = 17')
46 wq
47
Bram Moolenaarf3654822016-03-04 22:12:23 +010048 packadd mytest
Bram Moolenaar91715872016-03-03 17:13:03 +010049
50 call assert_equal(42, g:plugin_works)
Bram Moolenaar71fb0c12016-04-02 22:44:16 +020051 call assert_equal(77, g:plugin_also_works)
Bram Moolenaar91715872016-03-03 17:13:03 +010052 call assert_equal(17, g:ftdetect_works)
53 call assert_true(len(&rtp) > len(rtp))
Bram Moolenaar3b0d70f2022-08-29 22:31:20 +010054 call assert_match('/testdir/Xppdir/pack/mine/opt/mytest\($\|,\)', &rtp)
Bram Moolenaar99396d42018-09-08 18:21:16 +020055
Bram Moolenaar3b0d70f2022-08-29 22:31:20 +010056 let new_after = match(&rtp, '/testdir/Xppdir/pack/mine/opt/mytest/after,')
Bram Moolenaar53c8a472018-09-08 19:12:12 +020057 let forwarded = substitute(first_after_entry, '\\', '[/\\\\]', 'g')
58 let old_after = match(&rtp, ',' . forwarded . '\>')
Bram Moolenaar99396d42018-09-08 18:21:16 +020059 call assert_true(new_after > 0, 'rtp is ' . &rtp)
Bram Moolenaar53c8a472018-09-08 19:12:12 +020060 call assert_true(old_after > 0, 'match ' . forwarded . ' in ' . &rtp)
Bram Moolenaar99396d42018-09-08 18:21:16 +020061 call assert_true(new_after < old_after, 'rtp is ' . &rtp)
Bram Moolenaarbe82c252016-03-06 14:44:08 +010062
Bram Moolenaarf98a39c2018-04-18 22:18:23 +020063 " NOTE: '/.../opt/myte' forwardly matches with '/.../opt/mytest'
64 call mkdir(fnamemodify(s:plugdir, ':h') . '/myte', 'p')
65 let rtp = &rtp
66 packadd myte
67
68 " Check the path of 'myte' is added
69 call assert_true(len(&rtp) > len(rtp))
Bram Moolenaar3b0d70f2022-08-29 22:31:20 +010070 call assert_match('/testdir/Xppdir/pack/mine/opt/myte\($\|,\)', &rtp)
Bram Moolenaarf98a39c2018-04-18 22:18:23 +020071
Bram Moolenaarbe82c252016-03-06 14:44:08 +010072 " Check exception
73 call assert_fails("packadd directorynotfound", 'E919:')
74 call assert_fails("packadd", 'E471:')
Bram Moolenaar91715872016-03-03 17:13:03 +010075endfunc
76
Bram Moolenaar9e1d3992017-12-17 14:26:46 +010077func Test_packadd_start()
78 let plugdir = s:topdir . '/pack/mine/start/other'
79 call mkdir(plugdir . '/plugin', 'p')
80 set rtp&
81 let rtp = &rtp
82 filetype on
83
84 exe 'split ' . plugdir . '/plugin/test.vim'
85 call setline(1, 'let g:plugin_works = 24')
86 wq
87
88 packadd other
89
90 call assert_equal(24, g:plugin_works)
91 call assert_true(len(&rtp) > len(rtp))
Bram Moolenaar3b0d70f2022-08-29 22:31:20 +010092 call assert_match('/testdir/Xppdir/pack/mine/start/other\($\|,\)', &rtp)
Bram Moolenaar9e1d3992017-12-17 14:26:46 +010093endfunc
94
Bram Moolenaarf3654822016-03-04 22:12:23 +010095func Test_packadd_noload()
96 call mkdir(s:plugdir . '/plugin', 'p')
Bram Moolenaar91715872016-03-03 17:13:03 +010097 call mkdir(s:plugdir . '/syntax', 'p')
98 set rtp&
99 let rtp = &rtp
Bram Moolenaarf3654822016-03-04 22:12:23 +0100100
101 exe 'split ' . s:plugdir . '/plugin/test.vim'
102 call setline(1, 'let g:plugin_works = 42')
103 wq
104 let g:plugin_works = 0
105
106 packadd! mytest
107
Bram Moolenaar91715872016-03-03 17:13:03 +0100108 call assert_true(len(&rtp) > len(rtp))
Bram Moolenaar3b0d70f2022-08-29 22:31:20 +0100109 call assert_match('testdir/Xppdir/pack/mine/opt/mytest\($\|,\)', &rtp)
Bram Moolenaarf3654822016-03-04 22:12:23 +0100110 call assert_equal(0, g:plugin_works)
Bram Moolenaar91715872016-03-03 17:13:03 +0100111
112 " check the path is not added twice
113 let new_rtp = &rtp
Bram Moolenaarf3654822016-03-04 22:12:23 +0100114 packadd! mytest
Bram Moolenaar91715872016-03-03 17:13:03 +0100115 call assert_equal(new_rtp, &rtp)
Bram Moolenaar863c1a92016-03-03 15:47:06 +0100116endfunc
Bram Moolenaar35ca0e72016-03-05 17:41:49 +0100117
Bram Moolenaar2f9e5752017-02-05 16:07:54 +0100118func Test_packadd_symlink_dir()
Bram Moolenaar6d91bcb2020-08-12 18:50:36 +0200119 CheckUnix
Bram Moolenaar2f9e5752017-02-05 16:07:54 +0100120 let top2_dir = s:topdir . '/Xdir2'
121 let real_dir = s:topdir . '/Xsym'
Bram Moolenaar644df412017-03-09 13:58:02 +0100122 call mkdir(real_dir, 'p')
123 exec "silent !ln -s Xsym" top2_dir
Bram Moolenaar2f9e5752017-02-05 16:07:54 +0100124 let &rtp = top2_dir . ',' . top2_dir . '/after'
125 let &packpath = &rtp
126
127 let s:plugdir = top2_dir . '/pack/mine/opt/mytest'
128 call mkdir(s:plugdir . '/plugin', 'p')
129
130 exe 'split ' . s:plugdir . '/plugin/test.vim'
131 call setline(1, 'let g:plugin_works = 44')
132 wq
133 let g:plugin_works = 0
134
135 packadd mytest
136
137 " Must have been inserted in the middle, not at the end
Bram Moolenaar2374faa2018-02-04 17:47:42 +0100138 call assert_match('/pack/mine/opt/mytest,', &rtp)
Bram Moolenaar2f9e5752017-02-05 16:07:54 +0100139 call assert_equal(44, g:plugin_works)
140
141 " No change when doing it again.
142 let rtp_before = &rtp
143 packadd mytest
144 call assert_equal(rtp_before, &rtp)
145
146 set rtp&
147 let rtp = &rtp
Bram Moolenaar24f8f542017-02-11 23:00:36 +0100148 exec "silent !rm" top2_dir
Bram Moolenaar2f9e5752017-02-05 16:07:54 +0100149endfunc
150
Bram Moolenaar2374faa2018-02-04 17:47:42 +0100151func Test_packadd_symlink_dir2()
Bram Moolenaar6d91bcb2020-08-12 18:50:36 +0200152 CheckUnix
Bram Moolenaar2374faa2018-02-04 17:47:42 +0100153 let top2_dir = s:topdir . '/Xdir2'
154 let real_dir = s:topdir . '/Xsym/pack'
155 call mkdir(top2_dir, 'p')
156 call mkdir(real_dir, 'p')
157 let &rtp = top2_dir . ',' . top2_dir . '/after'
158 let &packpath = &rtp
159
160 exec "silent !ln -s ../Xsym/pack" top2_dir . '/pack'
161 let s:plugdir = top2_dir . '/pack/mine/opt/mytest'
162 call mkdir(s:plugdir . '/plugin', 'p')
163
164 exe 'split ' . s:plugdir . '/plugin/test.vim'
165 call setline(1, 'let g:plugin_works = 48')
166 wq
167 let g:plugin_works = 0
168
169 packadd mytest
170
171 " Must have been inserted in the middle, not at the end
172 call assert_match('/Xdir2/pack/mine/opt/mytest,', &rtp)
173 call assert_equal(48, g:plugin_works)
174
175 " No change when doing it again.
176 let rtp_before = &rtp
177 packadd mytest
178 call assert_equal(rtp_before, &rtp)
179
180 set rtp&
181 let rtp = &rtp
182 exec "silent !rm" top2_dir . '/pack'
183 exec "silent !rmdir" top2_dir
184endfunc
185
Bram Moolenaar35ca0e72016-03-05 17:41:49 +0100186" Check command-line completion for 'packadd'
187func Test_packadd_completion()
188 let optdir1 = &packpath . '/pack/mine/opt'
189 let optdir2 = &packpath . '/pack/candidate/opt'
190
191 call mkdir(optdir1 . '/pluginA', 'p')
192 call mkdir(optdir1 . '/pluginC', 'p')
zeertzjq3770f4c2023-01-22 18:38:51 +0000193 call writefile([], optdir1 . '/unrelated')
Bram Moolenaar35ca0e72016-03-05 17:41:49 +0100194 call mkdir(optdir2 . '/pluginB', 'p')
195 call mkdir(optdir2 . '/pluginC', 'p')
zeertzjq3770f4c2023-01-22 18:38:51 +0000196 call writefile([], optdir2 . '/unrelated')
Bram Moolenaar35ca0e72016-03-05 17:41:49 +0100197
198 let li = []
199 call feedkeys(":packadd \<Tab>')\<C-B>call add(li, '\<CR>", 't')
200 call feedkeys(":packadd " . repeat("\<Tab>", 2) . "')\<C-B>call add(li, '\<CR>", 't')
201 call feedkeys(":packadd " . repeat("\<Tab>", 3) . "')\<C-B>call add(li, '\<CR>", 't')
202 call feedkeys(":packadd " . repeat("\<Tab>", 4) . "')\<C-B>call add(li, '\<CR>", 'tx')
203 call assert_equal("packadd pluginA", li[0])
204 call assert_equal("packadd pluginB", li[1])
205 call assert_equal("packadd pluginC", li[2])
206 call assert_equal("packadd ", li[3])
207endfunc
Bram Moolenaar2d8f56a2016-03-12 20:34:27 +0100208
209func Test_packloadall()
Bram Moolenaar49b27322016-04-05 21:13:00 +0200210 " plugin foo with an autoload directory
211 let fooplugindir = &packpath . '/pack/mine/start/foo/plugin'
212 call mkdir(fooplugindir, 'p')
213 call writefile(['let g:plugin_foo_number = 1234',
214 \ 'let g:plugin_foo_auto = bbb#value',
215 \ 'let g:plugin_extra_auto = extra#value'], fooplugindir . '/bar.vim')
216 let fooautodir = &packpath . '/pack/mine/start/foo/autoload'
217 call mkdir(fooautodir, 'p')
218 call writefile(['let bar#value = 77'], fooautodir . '/bar.vim')
219
220 " plugin aaa with an autoload directory
221 let aaaplugindir = &packpath . '/pack/mine/start/aaa/plugin'
222 call mkdir(aaaplugindir, 'p')
223 call writefile(['let g:plugin_aaa_number = 333',
224 \ 'let g:plugin_aaa_auto = bar#value'], aaaplugindir . '/bbb.vim')
225 let aaaautodir = &packpath . '/pack/mine/start/aaa/autoload'
226 call mkdir(aaaautodir, 'p')
227 call writefile(['let bbb#value = 55'], aaaautodir . '/bbb.vim')
228
229 " plugin extra with only an autoload directory
230 let extraautodir = &packpath . '/pack/mine/start/extra/autoload'
231 call mkdir(extraautodir, 'p')
232 call writefile(['let extra#value = 99'], extraautodir . '/extra.vim')
233
Bram Moolenaar2d8f56a2016-03-12 20:34:27 +0100234 packloadall
235 call assert_equal(1234, g:plugin_foo_number)
Bram Moolenaar49b27322016-04-05 21:13:00 +0200236 call assert_equal(55, g:plugin_foo_auto)
237 call assert_equal(99, g:plugin_extra_auto)
238 call assert_equal(333, g:plugin_aaa_number)
239 call assert_equal(77, g:plugin_aaa_auto)
Bram Moolenaar2d8f56a2016-03-12 20:34:27 +0100240
241 " only works once
Bram Moolenaar49b27322016-04-05 21:13:00 +0200242 call writefile(['let g:plugin_bar_number = 4321'], fooplugindir . '/bar2.vim')
Bram Moolenaar2d8f56a2016-03-12 20:34:27 +0100243 packloadall
244 call assert_false(exists('g:plugin_bar_number'))
245
246 " works when ! used
247 packloadall!
248 call assert_equal(4321, g:plugin_bar_number)
249endfunc
Bram Moolenaar6bef5302016-03-12 21:28:26 +0100250
=?UTF-8?q?Bj=C3=B6rn=20Linse?=223a9502022-01-31 17:26:05 +0000251func Test_start_autoload()
252 " plugin foo with an autoload directory
253 let autodir = &packpath .. '/pack/mine/start/foo/autoload'
254 call mkdir(autodir, 'p')
255 let fname = autodir .. '/foobar.vim'
256 call writefile(['func foobar#test()',
257 \ ' return 1666',
258 \ 'endfunc'], fname)
259
260 call assert_equal(1666, foobar#test())
=?UTF-8?q?Bj=C3=B6rn=20Linse?=223a9502022-01-31 17:26:05 +0000261endfunc
262
Bram Moolenaar6bef5302016-03-12 21:28:26 +0100263func Test_helptags()
264 let docdir1 = &packpath . '/pack/mine/start/foo/doc'
265 let docdir2 = &packpath . '/pack/mine/start/bar/doc'
266 call mkdir(docdir1, 'p')
267 call mkdir(docdir2, 'p')
268 call writefile(['look here: *look-here*'], docdir1 . '/bar.txt')
269 call writefile(['look away: *look-away*'], docdir2 . '/foo.txt')
270 exe 'set rtp=' . &packpath . '/pack/mine/start/foo,' . &packpath . '/pack/mine/start/bar'
271
272 helptags ALL
273
274 let tags1 = readfile(docdir1 . '/tags')
Bram Moolenaar2374faa2018-02-04 17:47:42 +0100275 call assert_match('look-here', tags1[0])
Bram Moolenaar6bef5302016-03-12 21:28:26 +0100276 let tags2 = readfile(docdir2 . '/tags')
Bram Moolenaar2374faa2018-02-04 17:47:42 +0100277 call assert_match('look-away', tags2[0])
Bram Moolenaar5d98dc22020-01-29 21:57:34 +0100278
279 call assert_fails('helptags abcxyz', 'E150:')
Bram Moolenaar6bef5302016-03-12 21:28:26 +0100280endfunc
Bram Moolenaar7f8989d2016-03-12 22:11:39 +0100281
282func Test_colorscheme()
283 let colordirrun = &packpath . '/runtime/colors'
284 let colordirstart = &packpath . '/pack/mine/start/foo/colors'
285 let colordiropt = &packpath . '/pack/mine/opt/bar/colors'
286 call mkdir(colordirrun, 'p')
287 call mkdir(colordirstart, 'p')
288 call mkdir(colordiropt, 'p')
289 call writefile(['let g:found_one = 1'], colordirrun . '/one.vim')
290 call writefile(['let g:found_two = 1'], colordirstart . '/two.vim')
291 call writefile(['let g:found_three = 1'], colordiropt . '/three.vim')
292 exe 'set rtp=' . &packpath . '/runtime'
293
294 colorscheme one
295 call assert_equal(1, g:found_one)
296 colorscheme two
297 call assert_equal(1, g:found_two)
298 colorscheme three
299 call assert_equal(1, g:found_three)
300endfunc
Bram Moolenaar8dcf2592016-03-12 22:47:14 +0100301
Bram Moolenaar52f9c192016-03-13 13:24:45 +0100302func Test_colorscheme_completion()
303 let colordirrun = &packpath . '/runtime/colors'
304 let colordirstart = &packpath . '/pack/mine/start/foo/colors'
305 let colordiropt = &packpath . '/pack/mine/opt/bar/colors'
306 call mkdir(colordirrun, 'p')
307 call mkdir(colordirstart, 'p')
308 call mkdir(colordiropt, 'p')
309 call writefile(['let g:found_one = 1'], colordirrun . '/one.vim')
310 call writefile(['let g:found_two = 1'], colordirstart . '/two.vim')
311 call writefile(['let g:found_three = 1'], colordiropt . '/three.vim')
312 exe 'set rtp=' . &packpath . '/runtime'
313
314 let li=[]
315 call feedkeys(":colorscheme " . repeat("\<Tab>", 1) . "')\<C-B>call add(li, '\<CR>", 't')
316 call feedkeys(":colorscheme " . repeat("\<Tab>", 2) . "')\<C-B>call add(li, '\<CR>", 't')
317 call feedkeys(":colorscheme " . repeat("\<Tab>", 3) . "')\<C-B>call add(li, '\<CR>", 't')
318 call feedkeys(":colorscheme " . repeat("\<Tab>", 4) . "')\<C-B>call add(li, '\<CR>", 'tx')
319 call assert_equal("colorscheme one", li[0])
320 call assert_equal("colorscheme three", li[1])
321 call assert_equal("colorscheme two", li[2])
322 call assert_equal("colorscheme ", li[3])
323endfunc
324
Bram Moolenaar8dcf2592016-03-12 22:47:14 +0100325func Test_runtime()
326 let rundir = &packpath . '/runtime/extra'
327 let startdir = &packpath . '/pack/mine/start/foo/extra'
328 let optdir = &packpath . '/pack/mine/opt/bar/extra'
329 call mkdir(rundir, 'p')
330 call mkdir(startdir, 'p')
331 call mkdir(optdir, 'p')
332 call writefile(['let g:sequence .= "run"'], rundir . '/bar.vim')
333 call writefile(['let g:sequence .= "start"'], startdir . '/bar.vim')
334 call writefile(['let g:sequence .= "foostart"'], startdir . '/foo.vim')
335 call writefile(['let g:sequence .= "opt"'], optdir . '/bar.vim')
336 call writefile(['let g:sequence .= "xxxopt"'], optdir . '/xxx.vim')
337 exe 'set rtp=' . &packpath . '/runtime'
338
339 let g:sequence = ''
340 runtime extra/bar.vim
341 call assert_equal('run', g:sequence)
342 let g:sequence = ''
343 runtime START extra/bar.vim
344 call assert_equal('start', g:sequence)
345 let g:sequence = ''
346 runtime OPT extra/bar.vim
347 call assert_equal('opt', g:sequence)
348 let g:sequence = ''
349 runtime PACK extra/bar.vim
350 call assert_equal('start', g:sequence)
351 let g:sequence = ''
352 runtime! PACK extra/bar.vim
353 call assert_equal('startopt', g:sequence)
354 let g:sequence = ''
355 runtime PACK extra/xxx.vim
356 call assert_equal('xxxopt', g:sequence)
357
358 let g:sequence = ''
359 runtime ALL extra/bar.vim
360 call assert_equal('run', g:sequence)
361 let g:sequence = ''
362 runtime ALL extra/foo.vim
363 call assert_equal('foostart', g:sequence)
364 let g:sequence = ''
365 runtime! ALL extra/xxx.vim
366 call assert_equal('xxxopt', g:sequence)
367 let g:sequence = ''
368 runtime! ALL extra/bar.vim
369 call assert_equal('runstartopt', g:sequence)
370endfunc
Bram Moolenaar5d98dc22020-01-29 21:57:34 +0100371
zeertzjq3770f4c2023-01-22 18:38:51 +0000372func Test_runtime_completion()
373 let rundir = &packpath . '/runtime/Xextra'
374 let startdir = &packpath . '/pack/mine/start/foo/Xextra'
375 let optdir = &packpath . '/pack/mine/opt/bar/Xextra'
376 call mkdir(rundir . '/Xrunbaz', 'p')
377 call mkdir(startdir . '/Xstartbaz', 'p')
378 call mkdir(optdir . '/Xoptbaz', 'p')
379 call writefile([], rundir . '/../Xrunfoo.vim')
380 call writefile([], rundir . '/Xrunbar.vim')
381 call writefile([], rundir . '/Xunrelated')
382 call writefile([], rundir . '/../Xunrelated')
383 call writefile([], startdir . '/../Xstartfoo.vim')
384 call writefile([], startdir . '/Xstartbar.vim')
385 call writefile([], startdir . '/Xunrelated')
386 call writefile([], startdir . '/../Xunrelated')
387 call writefile([], optdir . '/../Xoptfoo.vim')
388 call writefile([], optdir . '/Xoptbar.vim')
389 call writefile([], optdir . '/Xunrelated')
390 call writefile([], optdir . '/../Xunrelated')
391 exe 'set rtp=' . &packpath . '/runtime'
392
393 func Check_runtime_completion(arg, arg1, res)
394 call feedkeys(':runtime ' .. a:arg .. "\<C-A>\<C-B>\"\<CR>", 'xt')
395 call assert_equal('"runtime ' .. a:arg1 .. join(a:res), @:)
396 call assert_equal(a:res, getcompletion(a:arg, 'runtime'))
397
398 call feedkeys(':runtime ' .. a:arg .. "X\<C-A>\<C-B>\"\<CR>", 'xt')
399 call assert_equal('"runtime ' .. a:arg1 .. join(a:res), @:)
400 call assert_equal(a:res, getcompletion(a:arg .. 'X', 'runtime'))
401 endfunc
402
403 call Check_runtime_completion('', '',
404 \ ['Xextra/', 'Xrunfoo.vim'])
405 call Check_runtime_completion('Xextra/', '',
406 \ ['Xextra/Xrunbar.vim', 'Xextra/Xrunbaz/'])
407
408 call Check_runtime_completion('START ', 'START ',
409 \ ['Xextra/', 'Xstartfoo.vim'])
410 call Check_runtime_completion('START Xextra/', 'START ',
411 \ ['Xextra/Xstartbar.vim', 'Xextra/Xstartbaz/'])
412
413 call Check_runtime_completion('OPT ', 'OPT ',
414 \ ['Xextra/', 'Xoptfoo.vim'])
415 call Check_runtime_completion('OPT Xextra/', 'OPT ',
416 \ ['Xextra/Xoptbar.vim', 'Xextra/Xoptbaz/'])
417
418 call Check_runtime_completion('PACK ', 'PACK ',
419 \ ['Xextra/', 'Xoptfoo.vim', 'Xstartfoo.vim'])
420 call Check_runtime_completion('PACK Xextra/', 'PACK ',
421 \ ['Xextra/Xoptbar.vim', 'Xextra/Xoptbaz/',
422 \ 'Xextra/Xstartbar.vim', 'Xextra/Xstartbaz/'])
423
424 call Check_runtime_completion('ALL ', 'ALL ',
425 \ ['Xextra/', 'Xoptfoo.vim', 'Xrunfoo.vim', 'Xstartfoo.vim'])
426 call Check_runtime_completion('ALL Xextra/', 'ALL ',
427 \ ['Xextra/Xoptbar.vim', 'Xextra/Xoptbaz/',
428 \ 'Xextra/Xrunbar.vim', 'Xextra/Xrunbaz/',
429 \ 'Xextra/Xstartbar.vim', 'Xextra/Xstartbaz/'])
430
431 delfunc Check_runtime_completion
432endfunc
433
Bram Moolenaar5d98dc22020-01-29 21:57:34 +0100434" vim: shiftwidth=2 sts=2 expandtab