diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-06-04 17:47:42 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-06-04 17:47:42 +0200 |
commit | ce876aaa9a250a5a0d0e34b3a2625e51cf9bf5bb (patch) | |
tree | 866d4fce5780c8a1df41501a65596238abc9dcc9 /src/testdir/test_startup.vim | |
parent | 976787d1f31451ca7a88e774a03e6c24ddc67876 (diff) | |
download | vim-git-ce876aaa9a250a5a0d0e34b3a2625e51cf9bf5bb.tar.gz |
patch 8.0.0612: pack dirs are added to 'runtimepath' too latev8.0.0612
Problem: Package directories are added to 'runtimepath' only after loading
non-package plugins.
Solution: Split off the code to add package directories to 'runtimepath'.
(Ingo Karkat, closes #1680)
Diffstat (limited to 'src/testdir/test_startup.vim')
-rw-r--r-- | src/testdir/test_startup.vim | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/testdir/test_startup.vim b/src/testdir/test_startup.vim index bce431f7d..08a107e81 100644 --- a/src/testdir/test_startup.vim +++ b/src/testdir/test_startup.vim @@ -61,6 +61,38 @@ func Test_after_comes_later() call delete('Xafter', 'rf') endfunc +func Test_pack_in_rtp_when_plugins_run() + if !has('packages') + return + endif + let before = [ + \ 'set nocp viminfo+=nviminfo', + \ 'set guioptions+=M', + \ 'let $HOME = "/does/not/exist"', + \ 'set loadplugins', + \ 'set rtp=Xhere', + \ 'set packpath=Xhere', + \ 'set nomore', + \ ] + let after = [ + \ 'quit', + \ ] + call mkdir('Xhere/plugin', 'p') + call writefile(['redir! > Xtestout', 'silent set runtimepath?', 'silent! call foo#Trigger()', 'redir END'], 'Xhere/plugin/here.vim') + call mkdir('Xhere/pack/foo/start/foobar/autoload', 'p') + call writefile(['function! foo#Trigger()', 'echo "autoloaded foo"', 'endfunction'], 'Xhere/pack/foo/start/foobar/autoload/foo.vim') + + if RunVim(before, after, '') + + let lines = filter(readfile('Xtestout'), '!empty(v:val)') + call assert_match('Xhere[/\\]pack[/\\]foo[/\\]start[/\\]foobar', get(lines, 0)) + call assert_match('autoloaded foo', get(lines, 1)) + endif + + call delete('Xtestout') + call delete('Xhere', 'rf') +endfunc + func Test_help_arg() if !has('unix') && has('gui') " this doesn't work with gvim on MS-Windows |