mirror of
https://github.com/junegunn/vim-plug.git
synced 2024-12-23 20:45:31 -07:00
tests: remove EnsureLoaded
This should not be necessary in general, and causes e.g. :FZF to be loaded from the global Vim runtime (causing an assertion failure in the tests). It is replaced by a verbatim / trimmed down `:runtime` for the "Check installed plugins" test.
This commit is contained in:
parent
46c62c7af9
commit
5ff3d279cf
@ -44,12 +44,6 @@ Execute (Initialize test environment):
|
|||||||
endfunction
|
endfunction
|
||||||
command! -nargs=+ -bang AssertExpect call AssertExpect('<bang>' == '!', <args>)
|
command! -nargs=+ -bang AssertExpect call AssertExpect('<bang>' == '!', <args>)
|
||||||
|
|
||||||
function! EnsureLoaded()
|
|
||||||
if has('vim_starting')
|
|
||||||
runtime! plugin/**/*.vim
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! RmRf(file)
|
function! RmRf(file)
|
||||||
call system(printf('rm -rf "%s"', a:file))
|
call system(printf('rm -rf "%s"', a:file))
|
||||||
endfunction
|
endfunction
|
||||||
@ -98,7 +92,6 @@ Execute (Cleanup):
|
|||||||
silent! delf PlugStatusSorted
|
silent! delf PlugStatusSorted
|
||||||
silent! delf AssertExpect
|
silent! delf AssertExpect
|
||||||
silent! delf PlugUpdated
|
silent! delf PlugUpdated
|
||||||
silent! delf EnsureLoaded
|
|
||||||
silent! delf ReloadPlug
|
silent! delf ReloadPlug
|
||||||
silent! delc AssertExpect
|
silent! delc AssertExpect
|
||||||
silent! unmap /
|
silent! unmap /
|
||||||
|
@ -634,7 +634,7 @@ Given (Unaligned code):
|
|||||||
aa=2
|
aa=2
|
||||||
|
|
||||||
Execute (Check installed plugins):
|
Execute (Check installed plugins):
|
||||||
call EnsureLoaded()
|
runtime plugin/fnr.vim plugin/redis.vim
|
||||||
Assert exists(':FNR'), 'FNR command should be found'
|
Assert exists(':FNR'), 'FNR command should be found'
|
||||||
Assert !exists(':RedisExecute'), 'RedisExecute command still should not be found'
|
Assert !exists(':RedisExecute'), 'RedisExecute command still should not be found'
|
||||||
|
|
||||||
@ -1393,7 +1393,6 @@ Execute (Strict load order):
|
|||||||
Plug '$PLUG_FIXTURES/xxx'
|
Plug '$PLUG_FIXTURES/xxx'
|
||||||
Plug '$PLUG_FIXTURES/yyy', { 'for': ['xxx'] }
|
Plug '$PLUG_FIXTURES/yyy', { 'for': ['xxx'] }
|
||||||
call plug#end()
|
call plug#end()
|
||||||
call EnsureLoaded()
|
|
||||||
setf xxx
|
setf xxx
|
||||||
Log 'Case 1: ' . &rtp
|
Log 'Case 1: ' . &rtp
|
||||||
AssertEqual ['yyy/ftdetect', 'yyy/after/ftdetect', 'xxx/ftdetect', 'xxx/after/ftdetect'], g:total_order[0:3]
|
AssertEqual ['yyy/ftdetect', 'yyy/after/ftdetect', 'xxx/ftdetect', 'xxx/after/ftdetect'], g:total_order[0:3]
|
||||||
@ -1407,7 +1406,6 @@ Execute (Strict load order):
|
|||||||
Plug '$PLUG_FIXTURES/xxx', { 'for': ['xxx'] }
|
Plug '$PLUG_FIXTURES/xxx', { 'for': ['xxx'] }
|
||||||
Plug '$PLUG_FIXTURES/yyy'
|
Plug '$PLUG_FIXTURES/yyy'
|
||||||
call plug#end()
|
call plug#end()
|
||||||
call EnsureLoaded()
|
|
||||||
set rtp^=manually-prepended
|
set rtp^=manually-prepended
|
||||||
set rtp+=manually-appended
|
set rtp+=manually-appended
|
||||||
setf xxx
|
setf xxx
|
||||||
@ -1427,7 +1425,6 @@ Execute (Strict load order):
|
|||||||
Plug '$PLUG_FIXTURES/xxx', { 'for': ['xxx'] }
|
Plug '$PLUG_FIXTURES/xxx', { 'for': ['xxx'] }
|
||||||
Plug '$PLUG_FIXTURES/yyy', { 'for': ['xxx'] }
|
Plug '$PLUG_FIXTURES/yyy', { 'for': ['xxx'] }
|
||||||
call plug#end()
|
call plug#end()
|
||||||
call EnsureLoaded()
|
|
||||||
setf xxx
|
setf xxx
|
||||||
Log 'Case 3: ' . &rtp
|
Log 'Case 3: ' . &rtp
|
||||||
AssertEqual ['xxx/ftdetect', 'xxx/after/ftdetect', 'yyy/ftdetect', 'yyy/after/ftdetect'], g:total_order[0:3]
|
AssertEqual ['xxx/ftdetect', 'xxx/after/ftdetect', 'yyy/ftdetect', 'yyy/after/ftdetect'], g:total_order[0:3]
|
||||||
|
Loading…
Reference in New Issue
Block a user