summaryrefslogtreecommitdiff
path: root/src/testdir/test_startup.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-06-27 14:43:55 +0200
committerBram Moolenaar <Bram@vim.org>2017-06-27 14:43:55 +0200
commit07ecfa64a18609a986f21d6132d04ee8934f3200 (patch)
tree310133eeb745e650be5406b1eeb5999aa6741421 /src/testdir/test_startup.vim
parent41cc038ff83498c589c7d25b3d2984145528eb92 (diff)
downloadvim-git-07ecfa64a18609a986f21d6132d04ee8934f3200.tar.gz
patch 8.0.0680: plugins in start packages are sourced twicev8.0.0680
Problem: Plugins in start packages are sourced twice. (mseplowitz) Solution: Use the unmodified runtime path when loading plugins (test by Ingo Karkat, closes #1801)
Diffstat (limited to 'src/testdir/test_startup.vim')
-rw-r--r--src/testdir/test_startup.vim20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/testdir/test_startup.vim b/src/testdir/test_startup.vim
index 08a107e81..af2b3c1d4 100644
--- a/src/testdir/test_startup.vim
+++ b/src/testdir/test_startup.vim
@@ -23,28 +23,34 @@ func Test_after_comes_later()
\ 'set guioptions+=M',
\ 'let $HOME = "/does/not/exist"',
\ 'set loadplugins',
- \ 'set rtp=Xhere,Xafter',
+ \ 'set rtp=Xhere,Xafter,Xanother',
\ 'set packpath=Xhere,Xafter',
\ 'set nomore',
+ \ 'let g:sequence = ""',
\ ]
let after = [
\ 'redir! > Xtestout',
\ 'scriptnames',
\ 'redir END',
+ \ 'redir! > Xsequence',
+ \ 'echo g:sequence',
+ \ 'redir END',
\ 'quit',
\ ]
call mkdir('Xhere/plugin', 'p')
- call writefile(['let done = 1'], 'Xhere/plugin/here.vim')
+ call writefile(['let g:sequence .= "here "'], 'Xhere/plugin/here.vim')
+ call mkdir('Xanother/plugin', 'p')
+ call writefile(['let g:sequence .= "another "'], 'Xanother/plugin/another.vim')
call mkdir('Xhere/pack/foo/start/foobar/plugin', 'p')
- call writefile(['let done = 1'], 'Xhere/pack/foo/start/foobar/plugin/foo.vim')
+ call writefile(['let g:sequence .= "pack "'], 'Xhere/pack/foo/start/foobar/plugin/foo.vim')
call mkdir('Xafter/plugin', 'p')
- call writefile(['let done = 1'], 'Xafter/plugin/later.vim')
+ call writefile(['let g:sequence .= "after "'], 'Xafter/plugin/later.vim')
if RunVim(before, after, '')
let lines = readfile('Xtestout')
- let expected = ['Xbefore.vim', 'here.vim', 'foo.vim', 'later.vim', 'Xafter.vim']
+ let expected = ['Xbefore.vim', 'here.vim', 'another.vim', 'foo.vim', 'later.vim', 'Xafter.vim']
let found = []
for line in lines
for one in expected
@@ -56,8 +62,12 @@ func Test_after_comes_later()
call assert_equal(expected, found)
endif
+ call assert_equal('here another pack after', substitute(join(readfile('Xsequence', 1), ''), '\s\+$', '', ''))
+
call delete('Xtestout')
+ call delete('Xsequence')
call delete('Xhere', 'rf')
+ call delete('Xanother', 'rf')
call delete('Xafter', 'rf')
endfunc