diff options
author | James McCoy <jamessan@jamessan.com> | 2017-08-21 12:10:15 -0400 |
---|---|---|
committer | James McCoy <jamessan@jamessan.com> | 2017-08-21 20:29:48 -0400 |
commit | a66eca78c2082aca112125f759be2ef3aa7ef832 (patch) | |
tree | 2953614b0608cf4a6c6ae531cf5f2081b09bd9c7 /test | |
parent | 9ff0cc70855fc3eb11ad0162ee02e742f354d360 (diff) | |
download | rneovim-a66eca78c2082aca112125f759be2ef3aa7ef832.tar.gz rneovim-a66eca78c2082aca112125f759be2ef3aa7ef832.tar.bz2 rneovim-a66eca78c2082aca112125f759be2ef3aa7ef832.zip |
vim-patch:8.0.0308
Problem: When using a symbolic link, the package path will not be inserted
at the right position in 'runtimepath'. (Dugan Chen, Norio Takagi)
Solution: Resolve symbolic links when finding the right position in
'runtimepath'. (Hirohito Higashi)
https://github.com/vim/vim/commit/2f9e575583c2ad3978ee3d0f790eeff7df56bd6c
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/legacy/packadd_spec.lua | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/functional/legacy/packadd_spec.lua b/test/functional/legacy/packadd_spec.lua index c280888dda..366a154f89 100644 --- a/test/functional/legacy/packadd_spec.lua +++ b/test/functional/legacy/packadd_spec.lua @@ -83,6 +83,39 @@ describe('packadd', function() call assert_equal(new_rtp, &rtp) endfunc + func Test_packadd_symlink_dir() + if !has('unix') + return + endif + let top2_dir = s:topdir . '/Xdir2' + let real_dir = s:topdir . '/Xsym' + silent !ln -s real_dir top2_dir + let &rtp = top2_dir . ',' . top2_dir . '/after' + let &packpath = &rtp + + let s:plugdir = top2_dir . '/pack/mine/opt/mytest' + call mkdir(s:plugdir . '/plugin', 'p') + + exe 'split ' . s:plugdir . '/plugin/test.vim' + call setline(1, 'let g:plugin_works = 44') + wq + let g:plugin_works = 0 + + packadd mytest + + " Must have been inserted in the middle, not at the end + call assert_true(&rtp =~ '/pack/mine/opt/mytest,') + call assert_equal(44, g:plugin_works) + + " No change when doing it again. + let rtp_before = &rtp + packadd mytest + call assert_equal(rtp_before, &rtp) + + set rtp& + let rtp = &rtp + endfunc + func Test_packloadall() " plugin foo with an autoload directory let fooplugindir = &packpath . '/pack/mine/start/foo/plugin' @@ -227,6 +260,11 @@ describe('packadd', function() expected_empty() end) + it('works with symlinks', function() + call('Test_packadd_symlink_dir') + expected_empty() + end) + it('works with :packloadall', function() call('Test_packloadall') expected_empty() |