From 46c62c7af9cd4ed8ec78e289f1788976538fb772 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 15 Jan 2018 03:50:49 +0100 Subject: [PATCH 1/2] test/run: use --noplugin and source vader --- test/run | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/run b/test/run index bcccba36..8110aede 100755 --- a/test/run +++ b/test/run @@ -16,6 +16,7 @@ mkdir -p "$TEMP" cat > $TEMP/mini-vimrc << VIMRC set rtp+=$TEMP/junegunn/vader.vim +source $TEMP/junegunn/vader.vim/plugin/vader.vim set shell=/bin/bash VIMRC @@ -122,9 +123,9 @@ git --version vim=$(select_vim) echo "Selected Vim: $vim" if [ "${1:-}" = '!' ]; then - $vim -Nu $TEMP/mini-vimrc -c 'Vader! test.vader' > /dev/null && + $vim --noplugin -Nu $TEMP/mini-vimrc -c 'Vader! test.vader' && prepare && - $vim -Nu $TEMP/mini-vimrc -c 'let g:plug_threads = 1 | Vader! test.vader' > /dev/null + $vim --noplugin -Nu $TEMP/mini-vimrc -c 'let g:plug_threads = 1 | Vader! test.vader' else - $vim -Nu $TEMP/mini-vimrc -c 'Vader test.vader' + $vim --noplugin -Nu $TEMP/mini-vimrc -c 'Vader test.vader' fi From 5ff3d279cf3d0beebbf3828b6b8d9240cd5935f2 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 15 Jan 2018 03:48:30 +0100 Subject: [PATCH 2/2] 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. --- test/test.vader | 7 ------- test/workflow.vader | 5 +---- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/test/test.vader b/test/test.vader index fc84668b..d6c2edbc 100644 --- a/test/test.vader +++ b/test/test.vader @@ -44,12 +44,6 @@ Execute (Initialize test environment): endfunction command! -nargs=+ -bang AssertExpect call AssertExpect('' == '!', ) - function! EnsureLoaded() - if has('vim_starting') - runtime! plugin/**/*.vim - endif - endfunction - function! RmRf(file) call system(printf('rm -rf "%s"', a:file)) endfunction @@ -98,7 +92,6 @@ Execute (Cleanup): silent! delf PlugStatusSorted silent! delf AssertExpect silent! delf PlugUpdated - silent! delf EnsureLoaded silent! delf ReloadPlug silent! delc AssertExpect silent! unmap / diff --git a/test/workflow.vader b/test/workflow.vader index 7e2c3528..179af0f1 100644 --- a/test/workflow.vader +++ b/test/workflow.vader @@ -634,7 +634,7 @@ Given (Unaligned code): aa=2 Execute (Check installed plugins): - call EnsureLoaded() + runtime plugin/fnr.vim plugin/redis.vim Assert exists(':FNR'), 'FNR command should 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/yyy', { 'for': ['xxx'] } call plug#end() - call EnsureLoaded() setf xxx Log 'Case 1: ' . &rtp 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/yyy' call plug#end() - call EnsureLoaded() set rtp^=manually-prepended set rtp+=manually-appended setf xxx @@ -1427,7 +1425,6 @@ Execute (Strict load order): Plug '$PLUG_FIXTURES/xxx', { 'for': ['xxx'] } Plug '$PLUG_FIXTURES/yyy', { 'for': ['xxx'] } call plug#end() - call EnsureLoaded() setf xxx Log 'Case 3: ' . &rtp AssertEqual ['xxx/ftdetect', 'xxx/after/ftdetect', 'yyy/ftdetect', 'yyy/after/ftdetect'], g:total_order[0:3]