diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-02-05 16:07:54 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-02-05 16:07:54 +0100 |
commit | 2f9e575583c2ad3978ee3d0f790eeff7df56bd6c (patch) | |
tree | 94bb8b22f774a8605319032cdc3915d984384cfa /src/testdir/test_packadd.vim | |
parent | 955f198fc546cc30a34361932d3f454a61df0efa (diff) | |
download | vim-git-2f9e575583c2ad3978ee3d0f790eeff7df56bd6c.tar.gz |
patch 8.0.0308: 'runtimepath' not update correctly when using symbolic linkv8.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)
Diffstat (limited to 'src/testdir/test_packadd.vim')
-rw-r--r-- | src/testdir/test_packadd.vim | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/testdir/test_packadd.vim b/src/testdir/test_packadd.vim index eca1560f7..5433c9866 100644 --- a/src/testdir/test_packadd.vim +++ b/src/testdir/test_packadd.vim @@ -67,6 +67,39 @@ func Test_packadd_noload() 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 + " Check command-line completion for 'packadd' func Test_packadd_completion() let optdir1 = &packpath . '/pack/mine/opt' |