diff options
author | James McCoy <jamessan@jamessan.com> | 2016-07-07 23:12:33 -0400 |
---|---|---|
committer | James McCoy <jamessan@jamessan.com> | 2016-07-08 01:45:21 -0400 |
commit | 23b2ee077130182c60d6639d99b45546902c8f80 (patch) | |
tree | 0dd3eeb4699e73bb9699311565941b747ca34c7f /test/functional/legacy/packadd_spec.lua | |
parent | 3f689ed327be0a391f8cdd15302583c02b04b4e2 (diff) | |
download | rneovim-23b2ee077130182c60d6639d99b45546902c8f80.tar.gz rneovim-23b2ee077130182c60d6639d99b45546902c8f80.tar.bz2 rneovim-23b2ee077130182c60d6639d99b45546902c8f80.zip |
vim-patch:7.4.1712
Problem: For plugins in packages, plugin authors need to take care of all
dependencies.
Solution: When loading "start" packages and for :packloadall, first add all
directories to 'runtimepath' before sourcing plugins.
https://github.com/vim/vim/commit/49b27326447d0827c59c6cd201d58f65c1163086
Diffstat (limited to 'test/functional/legacy/packadd_spec.lua')
-rw-r--r-- | test/functional/legacy/packadd_spec.lua | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/test/functional/legacy/packadd_spec.lua b/test/functional/legacy/packadd_spec.lua index d85467ced1..8c680f24b4 100644 --- a/test/functional/legacy/packadd_spec.lua +++ b/test/functional/legacy/packadd_spec.lua @@ -75,14 +75,40 @@ describe('packadd', function() endfunc func Test_packloadall() - let plugindir = &packpath . '/pack/mine/start/foo/plugin' - call mkdir(plugindir, 'p') - call writefile(['let g:plugin_foo_number = 1234'], plugindir . '/bar.vim') + " plugin foo with an autoload directory + let fooplugindir = &packpath . '/pack/mine/start/foo/plugin' + call mkdir(fooplugindir, 'p') + call writefile(['let g:plugin_foo_number = 1234', + \ 'let g:plugin_foo_auto = bbb#value', + \ 'let g:plugin_extra_auto = extra#value'], fooplugindir . '/bar.vim') + let fooautodir = &packpath . '/pack/mine/start/foo/autoload' + call mkdir(fooautodir, 'p') + call writefile(['let bar#value = 77'], fooautodir . '/bar.vim') + + " plugin aaa with an autoload directory + let aaaplugindir = &packpath . '/pack/mine/start/aaa/plugin' + call mkdir(aaaplugindir, 'p') + call writefile(['let g:plugin_aaa_number = 333', + \ 'let g:plugin_aaa_auto = bar#value'], aaaplugindir . '/bbb.vim') + let aaaautodir = &packpath . '/pack/mine/start/aaa/autoload' + call mkdir(aaaautodir, 'p') + call writefile(['let bbb#value = 55'], aaaautodir . '/bbb.vim') + + " plugin extra with only an autoload directory + let extraautodir = &packpath . '/pack/mine/start/extra/autoload' + call mkdir(extraautodir, 'p') + call writefile(['let extra#value = 99'], extraautodir . '/extra.vim') + packloadall call assert_equal(1234, g:plugin_foo_number) + call assert_equal(55, g:plugin_foo_auto) + call assert_equal(99, g:plugin_extra_auto) + call assert_equal(333, g:plugin_aaa_number) + call assert_equal(77, g:plugin_aaa_auto) " only works once - call writefile(['let g:plugin_bar_number = 4321'], plugindir . '/bar2.vim') + call writefile(['let g:plugin_bar_number = 4321'], + \ fooplugindir . '/bar2.vim') packloadall call assert_false(exists('g:plugin_bar_number')) |