From a66eca78c2082aca112125f759be2ef3aa7ef832 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Mon, 21 Aug 2017 12:10:15 -0400 Subject: 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 --- test/functional/legacy/packadd_spec.lua | 38 +++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'test/functional/legacy/packadd_spec.lua') 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() -- cgit From 24a556419627d3369f0a55b95dce07cb5316cf8b Mon Sep 17 00:00:00 2001 From: James McCoy Date: Mon, 21 Aug 2017 12:37:24 -0400 Subject: vim-patch:8.0.0325 Problem: Packadd test does not clean up symlink. Solution: Delete the link. (Hirohito Higashi) https://github.com/vim/vim/commit/913727e56761d57aaba61197c2d3485418dea7eb --- test/functional/legacy/packadd_spec.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'test/functional/legacy/packadd_spec.lua') diff --git a/test/functional/legacy/packadd_spec.lua b/test/functional/legacy/packadd_spec.lua index 366a154f89..ba6eba3ce3 100644 --- a/test/functional/legacy/packadd_spec.lua +++ b/test/functional/legacy/packadd_spec.lua @@ -114,6 +114,7 @@ describe('packadd', function() set rtp& let rtp = &rtp + silent !rm top2_dir endfunc func Test_packloadall() -- cgit From 651c6f9b6ebcd76fbf65045ab877fdf38b9d3db2 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Mon, 21 Aug 2017 12:38:24 -0400 Subject: vim-patch:8.0.0326 Problem: Packadd test uses wrong directory name. Solution: Use the variable name value. (Hirohito Higashi) https://github.com/vim/vim/commit/24f8f543d4036c5d2ce4ea6973a174cf2176cb72 --- test/functional/legacy/packadd_spec.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/functional/legacy/packadd_spec.lua') diff --git a/test/functional/legacy/packadd_spec.lua b/test/functional/legacy/packadd_spec.lua index ba6eba3ce3..620f2d7247 100644 --- a/test/functional/legacy/packadd_spec.lua +++ b/test/functional/legacy/packadd_spec.lua @@ -89,7 +89,7 @@ describe('packadd', function() endif let top2_dir = s:topdir . '/Xdir2' let real_dir = s:topdir . '/Xsym' - silent !ln -s real_dir top2_dir + exec "silent! !ln -s" real_dir top2_dir let &rtp = top2_dir . ',' . top2_dir . '/after' let &packpath = &rtp @@ -114,7 +114,7 @@ describe('packadd', function() set rtp& let rtp = &rtp - silent !rm top2_dir + exec "silent !rm" top2_dir endfunc func Test_packloadall() -- cgit From fc7bf1c71d41dae7b8ab7e82b92ec0e8253b5291 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Mon, 21 Aug 2017 12:46:07 -0400 Subject: vim-patch:8.0.0437 Problem: The packadd test does not create the symlink correctly and does not test the right thing. Solution: Create the directory and symlink correctly. https://github.com/vim/vim/commit/644df41c44cbdfacdedbba55ef77a6c6031eccd8 --- test/functional/legacy/packadd_spec.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test/functional/legacy/packadd_spec.lua') diff --git a/test/functional/legacy/packadd_spec.lua b/test/functional/legacy/packadd_spec.lua index 620f2d7247..7c44353aec 100644 --- a/test/functional/legacy/packadd_spec.lua +++ b/test/functional/legacy/packadd_spec.lua @@ -89,7 +89,8 @@ describe('packadd', function() endif let top2_dir = s:topdir . '/Xdir2' let real_dir = s:topdir . '/Xsym' - exec "silent! !ln -s" real_dir top2_dir + call mkdir(real_dir, 'p') + exec "silent! !ln -s Xsym" top2_dir let &rtp = top2_dir . ',' . top2_dir . '/after' let &packpath = &rtp -- cgit