comparison src/testdir/test_startup.vim @ 9778:4360b2b46125 v7.4.2164

commit https://github.com/vim/vim/commit/66459b7c98c67f8a9d39de8f08e8e8f1fca0e359 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Aug 6 19:01:55 2016 +0200 patch 7.4.2164 Problem: It is not possible to use plugins in an "after" directory to tune the behavior of a package. Solution: First load plugins from non-after directories, then packages and finally plugins in after directories. Reset 'loadplugins' before executing --cmd arguments.
author Christian Brabandt <cb@256bit.org>
date Sat, 06 Aug 2016 19:15:06 +0200
parents 8c9e13109df8
children 103ad8a18ebc
comparison
equal deleted inserted replaced
9777:cbd2d046575d 9778:4360b2b46125
1 " Tests for startup.
2
3 source shared.vim
4
1 " Check that loading startup.vim works. 5 " Check that loading startup.vim works.
2
3 func Test_startup_script() 6 func Test_startup_script()
4 set compatible 7 set compatible
5 source $VIMRUNTIME/defaults.vim 8 source $VIMRUNTIME/defaults.vim
6 9
7 call assert_equal(0, &compatible) 10 call assert_equal(0, &compatible)
8 endfunc 11 endfunc
12
13 " Verify the order in which plugins are loaded:
14 " 1. plugins in non-after directories
15 " 2. packages
16 " 3. plugins in after directories
17 func Test_after_comes_later()
18 let before = [
19 \ 'let $HOME = "/does/not/exist"',
20 \ 'set loadplugins',
21 \ 'set rtp=Xhere,Xafter',
22 \ 'set packpath=Xhere,Xafter',
23 \ 'set nomore',
24 \ ]
25 let after = [
26 \ 'redir! > Xtestout',
27 \ 'scriptnames',
28 \ 'redir END',
29 \ 'quit',
30 \ ]
31 call mkdir('Xhere/plugin', 'p')
32 call writefile(['let done = 1'], 'Xhere/plugin/here.vim')
33 call mkdir('Xhere/pack/foo/start/foobar/plugin', 'p')
34 call writefile(['let done = 1'], 'Xhere/pack/foo/start/foobar/plugin/foo.vim')
35
36 call mkdir('Xafter/plugin', 'p')
37 call writefile(['let done = 1'], 'Xafter/plugin/later.vim')
38
39 call RunVim(before, after)
40
41 let lines = readfile('Xtestout')
42 let expected = ['Xbefore.vim', 'here.vim', 'foo.vim', 'later.vim', 'Xafter.vim']
43 let found = []
44 for line in lines
45 for one in expected
46 if line =~ one
47 call add(found, one)
48 endif
49 endfor
50 endfor
51 call assert_equal(expected, found)
52
53 call delete('Xtestout')
54 call delete('Xhere', 'rf')
55 call delete('Xafter', 'rf')
56 endfunc