mirror of
https://github.com/junegunn/vim-plug.git
synced 2024-12-23 20:45:31 -07:00
Put cursor inside the installer window after post-update hook
https://github.com/chrisbra/unicode.vim/issues/16
This commit is contained in:
parent
cb5bed0e35
commit
05a1620bb1
1
plug.vim
1
plug.vim
@ -793,6 +793,7 @@ function! s:do(pull, force, todo)
|
|||||||
else
|
else
|
||||||
let error = 'Invalid hook type'
|
let error = 'Invalid hook type'
|
||||||
endif
|
endif
|
||||||
|
call s:switch_in()
|
||||||
call setline(4, empty(error) ? (getline(4) . 'OK')
|
call setline(4, empty(error) ? (getline(4) . 'OK')
|
||||||
\ : ('x' . getline(4)[1:] . error))
|
\ : ('x' . getline(4)[1:] . error))
|
||||||
if !empty(error)
|
if !empty(error)
|
||||||
|
@ -19,7 +19,7 @@ Execute (#112 On-demand loading should not suppress messages from ftplugin):
|
|||||||
|
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
Execute (#114 Should not contain empty path in &rtp):
|
Execute (#114 Should not contain empty path in &rtp):
|
||||||
call plug#begin('/tmp/plugged')
|
call plug#begin('/tmp/vim-plug-test/plugged')
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
||||||
Log &rtp
|
Log &rtp
|
||||||
@ -35,7 +35,7 @@ Execute (#130 Proper cleanup of on-demand loading triggers):
|
|||||||
|
|
||||||
" Cleared on command
|
" Cleared on command
|
||||||
call ReloadPlug()
|
call ReloadPlug()
|
||||||
call plug#begin('/tmp/plugged')
|
call plug#begin('/tmp/vim-plug-test/plugged')
|
||||||
Plug 'junegunn/vim-emoji', { 'on': ['EmojiCommand', 'EmojiCommand2', '<Plug>(EmojiMapping)'] }
|
Plug 'junegunn/vim-emoji', { 'on': ['EmojiCommand', 'EmojiCommand2', '<Plug>(EmojiMapping)'] }
|
||||||
call plug#end()
|
call plug#end()
|
||||||
PlugInstall | q
|
PlugInstall | q
|
||||||
@ -52,7 +52,7 @@ Execute (#130 Proper cleanup of on-demand loading triggers):
|
|||||||
|
|
||||||
" Cleared on FileType
|
" Cleared on FileType
|
||||||
call ReloadPlug()
|
call ReloadPlug()
|
||||||
call plug#begin('/tmp/plugged')
|
call plug#begin('/tmp/vim-plug-test/plugged')
|
||||||
Plug 'junegunn/vim-emoji', { 'on': ['EmojiCommandExtra', '<Plug>(EmojiMappingExtra)'], 'for': ['emoji'] }
|
Plug 'junegunn/vim-emoji', { 'on': ['EmojiCommandExtra', '<Plug>(EmojiMappingExtra)'], 'for': ['emoji'] }
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
||||||
@ -78,13 +78,13 @@ Execute (#131 Syntax error):
|
|||||||
**********************************************************************
|
**********************************************************************
|
||||||
Execute (#139-1 Using new remote branch):
|
Execute (#139-1 Using new remote branch):
|
||||||
" Make sure to remove the clone
|
" Make sure to remove the clone
|
||||||
call plug#begin('/tmp/plugged')
|
call plug#begin('/tmp/vim-plug-test/plugged')
|
||||||
call plug#end()
|
call plug#end()
|
||||||
PlugClean!
|
PlugClean!
|
||||||
|
|
||||||
" Install master branch
|
" Install master branch
|
||||||
call plug#begin('/tmp/plugged')
|
call plug#begin('/tmp/vim-plug-test/plugged')
|
||||||
Plug expand('file:////tmp/new-branch')
|
Plug expand('file:////tmp/vim-plug-test/new-branch')
|
||||||
call plug#end()
|
call plug#end()
|
||||||
PlugUpdate
|
PlugUpdate
|
||||||
|
|
||||||
@ -95,14 +95,14 @@ Execute (#139-1 Using new remote branch):
|
|||||||
Assert !exists('g:baz'), 'g:baz should not be found'
|
Assert !exists('g:baz'), 'g:baz should not be found'
|
||||||
|
|
||||||
" Create a new branch on origin
|
" Create a new branch on origin
|
||||||
call system('cd /tmp/new-branch && git checkout -b new &&'
|
call system('cd /tmp/vim-plug-test/new-branch && git checkout -b new &&'
|
||||||
\. 'echo "let g:bar = 1" > plugin/bar.vim && git add plugin/bar.vim &&'
|
\. 'echo "let g:bar = 1" > plugin/bar.vim && git add plugin/bar.vim &&'
|
||||||
\. 'git commit -m second')
|
\. 'git commit -m second')
|
||||||
|
|
||||||
" We're setting up two plugins so that parallel installer is used
|
" We're setting up two plugins so that parallel installer is used
|
||||||
call plug#begin('/tmp/plugged')
|
call plug#begin('/tmp/vim-plug-test/plugged')
|
||||||
Plug 'junegunn/seoul256.vim'
|
Plug 'junegunn/seoul256.vim'
|
||||||
Plug expand('file:////tmp/new-branch'), { 'branch': 'new' }
|
Plug expand('file:////tmp/vim-plug-test/new-branch'), { 'branch': 'new' }
|
||||||
call plug#end()
|
call plug#end()
|
||||||
PlugUpdate
|
PlugUpdate
|
||||||
silent %y
|
silent %y
|
||||||
@ -125,14 +125,14 @@ Expect:
|
|||||||
|
|
||||||
Execute (#139-2 Using yet another new remote branch):
|
Execute (#139-2 Using yet another new remote branch):
|
||||||
" Create another branch on origin
|
" Create another branch on origin
|
||||||
call system('cd /tmp/new-branch && git checkout master &&'
|
call system('cd /tmp/vim-plug-test/new-branch && git checkout master &&'
|
||||||
\. 'git checkout -b brand-new &&'
|
\. 'git checkout -b brand-new &&'
|
||||||
\. 'echo "let g:baz = 1" > plugin/baz.vim && git add plugin/baz.vim &&'
|
\. 'echo "let g:baz = 1" > plugin/baz.vim && git add plugin/baz.vim &&'
|
||||||
\. 'git commit -m third')
|
\. 'git commit -m third')
|
||||||
|
|
||||||
" Test Vim installer here
|
" Test Vim installer here
|
||||||
call plug#begin('/tmp/plugged')
|
call plug#begin('/tmp/vim-plug-test/plugged')
|
||||||
Plug expand('file:////tmp/new-branch'), { 'branch': 'brand-new' }
|
Plug expand('file:////tmp/vim-plug-test/new-branch'), { 'branch': 'brand-new' }
|
||||||
call plug#end()
|
call plug#end()
|
||||||
PlugUpdate
|
PlugUpdate
|
||||||
silent %y
|
silent %y
|
||||||
@ -154,19 +154,19 @@ Expect:
|
|||||||
|
|
||||||
Execute (#139-3 Should fail when not possible to fast-forward):
|
Execute (#139-3 Should fail when not possible to fast-forward):
|
||||||
" Commit on cloned repo
|
" Commit on cloned repo
|
||||||
call system('cd /tmp/plugged/new-branch && git checkout master &&'
|
call system('cd /tmp/vim-plug-test/plugged/new-branch && git checkout master &&'
|
||||||
\. 'touch foobar && git add foobar && git commit -m foobar')
|
\. 'touch foobar && git add foobar && git commit -m foobar')
|
||||||
|
|
||||||
" Different commit on remote
|
" Different commit on remote
|
||||||
call system('cd /tmp/new-branch && git checkout master &&'
|
call system('cd /tmp/vim-plug-test/new-branch && git checkout master &&'
|
||||||
\. 'touch foobaz && git add foobaz && git commit -m foobaz')
|
\. 'touch foobaz && git add foobaz && git commit -m foobaz')
|
||||||
|
|
||||||
for multi in [0, 1]
|
for multi in [0, 1]
|
||||||
call plug#begin('/tmp/plugged')
|
call plug#begin('/tmp/vim-plug-test/plugged')
|
||||||
if multi
|
if multi
|
||||||
Plug 'junegunn/seoul256.vim'
|
Plug 'junegunn/seoul256.vim'
|
||||||
endif
|
endif
|
||||||
Plug expand('file:////tmp/new-branch')
|
Plug expand('file:////tmp/vim-plug-test/new-branch')
|
||||||
call plug#end()
|
call plug#end()
|
||||||
PlugUpdate
|
PlugUpdate
|
||||||
silent %y
|
silent %y
|
||||||
@ -210,7 +210,7 @@ Execute (#159: shell=/bin/tcsh):
|
|||||||
let org = &shell
|
let org = &shell
|
||||||
try
|
try
|
||||||
set shell=/bin/tcsh
|
set shell=/bin/tcsh
|
||||||
call plug#begin('/tmp/plugged')
|
call plug#begin('/tmp/vim-plug-test/plugged')
|
||||||
Plug 'junegunn/seoul256.vim'
|
Plug 'junegunn/seoul256.vim'
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
||||||
@ -224,7 +224,7 @@ Execute (#159: shell=/bin/tcsh):
|
|||||||
|
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
Execute (#154: Spaces in &rtp should not be escaped):
|
Execute (#154: Spaces in &rtp should not be escaped):
|
||||||
call plug#begin('/tmp/plug it')
|
call plug#begin('/tmp/vim-plug-test/plug it')
|
||||||
Plug 'seoul256 vim'
|
Plug 'seoul256 vim'
|
||||||
call plug#end()
|
call plug#end()
|
||||||
Log &rtp
|
Log &rtp
|
||||||
@ -232,7 +232,7 @@ Execute (#154: Spaces in &rtp should not be escaped):
|
|||||||
|
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
Execute (#184: Duplicate entries in &rtp):
|
Execute (#184: Duplicate entries in &rtp):
|
||||||
call plug#begin('/tmp/plugged')
|
call plug#begin('/tmp/vim-plug-test/plugged')
|
||||||
Plug 'plugin1'
|
Plug 'plugin1'
|
||||||
\| Plug 'plugin0'
|
\| Plug 'plugin0'
|
||||||
|
|
||||||
@ -250,7 +250,7 @@ Execute (#236: Plugin removed from &rtp when .vimrc is reloaded):
|
|||||||
silent! delc EasyAlign
|
silent! delc EasyAlign
|
||||||
|
|
||||||
call ReloadPlug()
|
call ReloadPlug()
|
||||||
call plug#begin('/tmp/plugged')
|
call plug#begin('/tmp/vim-plug-test/plugged')
|
||||||
Plug 'junegunn/vim-easy-align', { 'on': 'EasyAlign' }
|
Plug 'junegunn/vim-easy-align', { 'on': 'EasyAlign' }
|
||||||
call plug#end()
|
call plug#end()
|
||||||
PlugInstall | q
|
PlugInstall | q
|
||||||
@ -259,19 +259,19 @@ Execute (#236: Plugin removed from &rtp when .vimrc is reloaded):
|
|||||||
%EasyAlign=
|
%EasyAlign=
|
||||||
Assert &rtp =~ '/vim-easy-align', 'Plugin should be in &rtp'
|
Assert &rtp =~ '/vim-easy-align', 'Plugin should be in &rtp'
|
||||||
|
|
||||||
call plug#begin('/tmp/plugged')
|
call plug#begin('/tmp/vim-plug-test/plugged')
|
||||||
Plug 'junegunn/vim-easy-align', { 'on': 'EasyAlign' }
|
Plug 'junegunn/vim-easy-align', { 'on': 'EasyAlign' }
|
||||||
call plug#end()
|
call plug#end()
|
||||||
Assert &rtp =~ '/vim-easy-align', 'Plugin should still be in &rtp'
|
Assert &rtp =~ '/vim-easy-align', 'Plugin should still be in &rtp'
|
||||||
|
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
Execute (#350: Ruby installer failed to unshallow tagged plugin on update):
|
Execute (#350: Ruby installer failed to unshallow tagged plugin on update):
|
||||||
call plug#begin('/tmp/plugged')
|
call plug#begin('/tmp/vim-plug-test/plugged')
|
||||||
call plug#end()
|
call plug#end()
|
||||||
PlugClean!
|
PlugClean!
|
||||||
|
|
||||||
" Shallow clone. We should have at least 2 plugins to enable parallel installer.
|
" Shallow clone. We should have at least 2 plugins to enable parallel installer.
|
||||||
call plug#begin('/tmp/plugged')
|
call plug#begin('/tmp/vim-plug-test/plugged')
|
||||||
Plug 'junegunn/vim-easy-align'
|
Plug 'junegunn/vim-easy-align'
|
||||||
Plug 'junegunn/seoul256.vim'
|
Plug 'junegunn/seoul256.vim'
|
||||||
call plug#end()
|
call plug#end()
|
||||||
@ -279,7 +279,7 @@ Execute (#350: Ruby installer failed to unshallow tagged plugin on update):
|
|||||||
Assert filereadable(g:plugs['vim-easy-align'].dir.'/.git/shallow')
|
Assert filereadable(g:plugs['vim-easy-align'].dir.'/.git/shallow')
|
||||||
|
|
||||||
" Now unshallowed
|
" Now unshallowed
|
||||||
call plug#begin('/tmp/plugged')
|
call plug#begin('/tmp/vim-plug-test/plugged')
|
||||||
Plug 'junegunn/vim-easy-align', { 'tag': '2.9.0' }
|
Plug 'junegunn/vim-easy-align', { 'tag': '2.9.0' }
|
||||||
Plug 'junegunn/seoul256.vim'
|
Plug 'junegunn/seoul256.vim'
|
||||||
call plug#end()
|
call plug#end()
|
||||||
@ -289,13 +289,13 @@ Execute (#350: Ruby installer failed to unshallow tagged plugin on update):
|
|||||||
|
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
Execute (#474: Load ftdetect files in filetypedetect augroup):
|
Execute (#474: Load ftdetect files in filetypedetect augroup):
|
||||||
call plug#begin('/tmp/plugged')
|
call plug#begin('/tmp/vim-plug-test/plugged')
|
||||||
Plug 'junegunn/rust.vim', { 'for': 'rust', 'commit': '115d321d383eb96d438466c56cc871fcc1bd0faa' }
|
Plug 'junegunn/rust.vim', { 'for': 'rust', 'commit': '115d321d383eb96d438466c56cc871fcc1bd0faa' }
|
||||||
call plug#end()
|
call plug#end()
|
||||||
PlugInstall!
|
PlugInstall!
|
||||||
q
|
q
|
||||||
|
|
||||||
tabnew /tmp/any.rs
|
tabnew /tmp/vim-plug-test/any.rs
|
||||||
AssertEqual 'rust', &filetype
|
AssertEqual 'rust', &filetype
|
||||||
Log &filetype
|
Log &filetype
|
||||||
filetype detect
|
filetype detect
|
||||||
@ -315,3 +315,18 @@ Execute (#489 On-demand loading with 'on' option should trigger BufRead autocmd)
|
|||||||
redir END
|
redir END
|
||||||
Assert stridx(out, 'ftplugin-java') >= 0
|
Assert stridx(out, 'ftplugin-java') >= 0
|
||||||
q
|
q
|
||||||
|
|
||||||
|
**********************************************************************
|
||||||
|
Execute (Cursor moved to another window during post-update hook):
|
||||||
|
function! DoSplit(...)
|
||||||
|
new
|
||||||
|
call setline(1, 'empty')
|
||||||
|
endfunction
|
||||||
|
call plug#begin('/tmp/vim-plug-test/plugged')
|
||||||
|
Plug 'junegunn/rust.vim', { 'do': function('DoSplit') }
|
||||||
|
call plug#end()
|
||||||
|
PlugInstall!
|
||||||
|
AssertEqual 1, line('$')
|
||||||
|
AssertEqual 'empty', getline(1)
|
||||||
|
q!
|
||||||
|
q
|
||||||
|
19
test/run
19
test/run
@ -6,9 +6,12 @@ export BASE="$PWD"
|
|||||||
export PLUG_SRC="$PWD/../plug.vim"
|
export PLUG_SRC="$PWD/../plug.vim"
|
||||||
export PLUG_FIXTURES="$PWD/fixtures"
|
export PLUG_FIXTURES="$PWD/fixtures"
|
||||||
mkdir -p "$PLUG_FIXTURES"
|
mkdir -p "$PLUG_FIXTURES"
|
||||||
|
export TEMP=/tmp/vim-plug-test
|
||||||
|
rm -rf "$TEMP"
|
||||||
|
mkdir -p "$TEMP"
|
||||||
|
|
||||||
cat > /tmp/mini-vimrc << VIMRC
|
cat > $TEMP/mini-vimrc << VIMRC
|
||||||
set rtp+=/tmp/junegunn/vader.vim
|
set rtp+=$TEMP/junegunn/vader.vim
|
||||||
set shell=/bin/bash
|
set shell=/bin/bash
|
||||||
VIMRC
|
VIMRC
|
||||||
|
|
||||||
@ -19,7 +22,7 @@ clone() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
clone_repos() (
|
clone_repos() (
|
||||||
cd /tmp
|
cd $TEMP
|
||||||
mkdir -p junegunn vim-scripts jg
|
mkdir -p junegunn vim-scripts jg
|
||||||
for repo in vader.vim goyo.vim rust.vim seoul256.vim vim-easy-align vim-fnr \
|
for repo in vader.vim goyo.vim rust.vim seoul256.vim vim-easy-align vim-fnr \
|
||||||
vim-oblique vim-pseudocl vim-redis vim-emoji; do
|
vim-oblique vim-pseudocl vim-redis vim-emoji; do
|
||||||
@ -80,8 +83,8 @@ DOC
|
|||||||
echo "echomsg 'ftplugin-c'" > "$PLUG_FIXTURES/ftplugin-msg/ftplugin/c.vim"
|
echo "echomsg 'ftplugin-c'" > "$PLUG_FIXTURES/ftplugin-msg/ftplugin/c.vim"
|
||||||
echo "echomsg 'ftplugin-java'" > "$PLUG_FIXTURES/ftplugin-msg/ftplugin/java.vim"
|
echo "echomsg 'ftplugin-java'" > "$PLUG_FIXTURES/ftplugin-msg/ftplugin/java.vim"
|
||||||
|
|
||||||
rm -rf /tmp/new-branch
|
rm -rf $TEMP/new-branch
|
||||||
cd /tmp
|
cd $TEMP
|
||||||
git init new-branch
|
git init new-branch
|
||||||
cd new-branch
|
cd new-branch
|
||||||
mkdir plugin
|
mkdir plugin
|
||||||
@ -109,10 +112,10 @@ git --version
|
|||||||
VIM=$(select_vim)
|
VIM=$(select_vim)
|
||||||
echo "Selected Vim: $VIM"
|
echo "Selected Vim: $VIM"
|
||||||
if [ "$1" = '!' ]; then
|
if [ "$1" = '!' ]; then
|
||||||
$VIM -Nu /tmp/mini-vimrc -c 'Vader! test.vader' > /dev/null &&
|
$VIM -Nu $TEMP/mini-vimrc -c 'Vader! test.vader' > /dev/null &&
|
||||||
prepare &&
|
prepare &&
|
||||||
$VIM -Nu /tmp/mini-vimrc -c 'let g:plug_threads = 1 | Vader! test.vader' > /dev/null
|
$VIM -Nu $TEMP/mini-vimrc -c 'let g:plug_threads = 1 | Vader! test.vader' > /dev/null
|
||||||
else
|
else
|
||||||
$VIM -Nu /tmp/mini-vimrc -c 'Vader test.vader'
|
$VIM -Nu $TEMP/mini-vimrc -c 'Vader test.vader'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ Execute (Initialize test environment):
|
|||||||
Save &rtp, g:plugs, g:plug_home, g:plug_window
|
Save &rtp, g:plugs, g:plug_home, g:plug_window
|
||||||
unlet! g:plugs g:plug_home g:plug_window
|
unlet! g:plugs g:plug_home g:plug_window
|
||||||
|
|
||||||
let g:plug_url_format = 'file:///tmp/%s'
|
let g:plug_url_format = 'file:///tmp/vim-plug-test/%s'
|
||||||
let g:base_rtp = &rtp
|
let g:base_rtp = &rtp
|
||||||
let g:first_rtp = split(&rtp, ',')[0]
|
let g:first_rtp = split(&rtp, ',')[0]
|
||||||
let g:last_rtp = split(&rtp, ',')[-1]
|
let g:last_rtp = split(&rtp, ',')[-1]
|
||||||
|
@ -34,7 +34,7 @@ Execute (Subsequent plug#begin() calls will reuse g:plug_home):
|
|||||||
Execute (Test Plug command):
|
Execute (Test Plug command):
|
||||||
^ Git repo with branch (DEPRECATED. USE BRANCH OPTION)
|
^ Git repo with branch (DEPRECATED. USE BRANCH OPTION)
|
||||||
Plug 'junegunn/seoul256.vim', { 'branch': 'yes-t_co' }
|
Plug 'junegunn/seoul256.vim', { 'branch': 'yes-t_co' }
|
||||||
AssertEqual 'file:///tmp/junegunn/seoul256.vim', g:plugs['seoul256.vim'].uri
|
AssertEqual 'file:///tmp/vim-plug-test/junegunn/seoul256.vim', g:plugs['seoul256.vim'].uri
|
||||||
AssertEqual join([g:temp_plugged, 'seoul256.vim/'], '/'), g:plugs['seoul256.vim'].dir
|
AssertEqual join([g:temp_plugged, 'seoul256.vim/'], '/'), g:plugs['seoul256.vim'].dir
|
||||||
AssertEqual 'yes-t_co', g:plugs['seoul256.vim'].branch
|
AssertEqual 'yes-t_co', g:plugs['seoul256.vim'].branch
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ Execute (Test Plug command):
|
|||||||
|
|
||||||
^ Git repo with tag (DEPRECATED. USE TAG OPTION)
|
^ Git repo with tag (DEPRECATED. USE TAG OPTION)
|
||||||
Plug 'junegunn/goyo.vim', '1.5.2'
|
Plug 'junegunn/goyo.vim', '1.5.2'
|
||||||
AssertEqual 'file:///tmp/junegunn/goyo.vim', g:plugs['goyo.vim'].uri
|
AssertEqual 'file:///tmp/vim-plug-test/junegunn/goyo.vim', g:plugs['goyo.vim'].uri
|
||||||
AssertEqual join([g:temp_plugged, 'goyo.vim/'], '/'), g:plugs['goyo.vim'].dir
|
AssertEqual join([g:temp_plugged, 'goyo.vim/'], '/'), g:plugs['goyo.vim'].dir
|
||||||
AssertEqual '1.5.2', g:plugs['goyo.vim'].tag
|
AssertEqual '1.5.2', g:plugs['goyo.vim'].tag
|
||||||
|
|
||||||
@ -51,14 +51,14 @@ Execute (Test Plug command):
|
|||||||
AssertEqual '1.5.3', g:plugs['goyo.vim'].tag
|
AssertEqual '1.5.3', g:plugs['goyo.vim'].tag
|
||||||
|
|
||||||
" Git URI
|
" Git URI
|
||||||
Plug 'file:///tmp/jg/vim-emoji'
|
Plug 'file:///tmp/vim-plug-test/jg/vim-emoji'
|
||||||
AssertEqual 'file:///tmp/jg/vim-emoji', g:plugs['vim-emoji'].uri
|
AssertEqual 'file:///tmp/vim-plug-test/jg/vim-emoji', g:plugs['vim-emoji'].uri
|
||||||
AssertEqual 'master', g:plugs['vim-emoji'].branch
|
AssertEqual 'master', g:plugs['vim-emoji'].branch
|
||||||
AssertEqual join([g:temp_plugged, 'vim-emoji/'], '/'), g:plugs['vim-emoji'].dir
|
AssertEqual join([g:temp_plugged, 'vim-emoji/'], '/'), g:plugs['vim-emoji'].dir
|
||||||
|
|
||||||
" vim-scripts/
|
" vim-scripts/
|
||||||
Plug 'beauty256'
|
Plug 'beauty256'
|
||||||
AssertEqual 'file:///tmp/vim-scripts/beauty256', g:plugs.beauty256.uri
|
AssertEqual 'file:///tmp/vim-plug-test/vim-scripts/beauty256', g:plugs.beauty256.uri
|
||||||
AssertEqual 'master', g:plugs.beauty256.branch
|
AssertEqual 'master', g:plugs.beauty256.branch
|
||||||
|
|
||||||
AssertEqual 4, len(g:plugs)
|
AssertEqual 4, len(g:plugs)
|
||||||
@ -84,7 +84,7 @@ Execute (PlugClean before installation):
|
|||||||
|
|
||||||
Execute (plug#end() updates &rtp):
|
Execute (plug#end() updates &rtp):
|
||||||
" Plug 'junegunn/goyo.vim', { 'tag': '1.5.3' }
|
" Plug 'junegunn/goyo.vim', { 'tag': '1.5.3' }
|
||||||
" Plug 'file:///tmp/jg/vim-emoji'
|
" Plug 'file:///tmp/vim-plug-test/jg/vim-emoji'
|
||||||
" Plug 'beauty256'
|
" Plug 'beauty256'
|
||||||
" Plug 'junegunn/seoul256.vim', { 'branch': 'no-t_co', 'rtp': '././' }
|
" Plug 'junegunn/seoul256.vim', { 'branch': 'no-t_co', 'rtp': '././' }
|
||||||
call plug#end()
|
call plug#end()
|
||||||
@ -159,7 +159,7 @@ Expect:
|
|||||||
Execute (Change branch of seoul256.vim):
|
Execute (Change branch of seoul256.vim):
|
||||||
call plug#begin()
|
call plug#begin()
|
||||||
Plug 'junegunn/seoul256.vim'
|
Plug 'junegunn/seoul256.vim'
|
||||||
Plug 'file:///tmp/jg/vim-emoji'
|
Plug 'file:///tmp/vim-plug-test/jg/vim-emoji'
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
||||||
Execute (PlugStatus):
|
Execute (PlugStatus):
|
||||||
@ -197,15 +197,15 @@ Expect:
|
|||||||
Execute (Change URI of seoul256.vim):
|
Execute (Change URI of seoul256.vim):
|
||||||
call plug#begin()
|
call plug#begin()
|
||||||
Plug 'junegunn.choi/seoul256.vim'
|
Plug 'junegunn.choi/seoul256.vim'
|
||||||
Plug 'file:///tmp/jg/vim-emoji'
|
Plug 'file:///tmp/vim-plug-test/jg/vim-emoji'
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
||||||
Execute (PlugStatus):
|
Execute (PlugStatus):
|
||||||
call PlugStatusSorted()
|
call PlugStatusSorted()
|
||||||
|
|
||||||
Expect:
|
Expect:
|
||||||
Expected: file:///tmp/junegunn.choi/seoul256.vim
|
Expected: file:///tmp/vim-plug-test/junegunn.choi/seoul256.vim
|
||||||
Invalid URI: file:///tmp/junegunn/seoul256.vim
|
Invalid URI: file:///tmp/vim-plug-test/junegunn/seoul256.vim
|
||||||
PlugClean required.
|
PlugClean required.
|
||||||
- vim-emoji: OK
|
- vim-emoji: OK
|
||||||
Finished. 1 error(s).
|
Finished. 1 error(s).
|
||||||
@ -215,7 +215,7 @@ Expect:
|
|||||||
Execute (Corrected the URI but diverged from master):
|
Execute (Corrected the URI but diverged from master):
|
||||||
call plug#begin()
|
call plug#begin()
|
||||||
Plug 'junegunn/seoul256.vim'
|
Plug 'junegunn/seoul256.vim'
|
||||||
Plug 'file:///tmp/jg/vim-emoji'
|
Plug 'file:///tmp/vim-plug-test/jg/vim-emoji'
|
||||||
call plug#end()
|
call plug#end()
|
||||||
for _ in range(3)
|
for _ in range(3)
|
||||||
call system(printf('cd "%s" && git commit --allow-empty -m "dummy"', g:plugs['seoul256.vim'].dir))
|
call system(printf('cd "%s" && git commit --allow-empty -m "dummy"', g:plugs['seoul256.vim'].dir))
|
||||||
@ -257,8 +257,8 @@ Execute (PlugStatus):
|
|||||||
call PlugStatusSorted()
|
call PlugStatusSorted()
|
||||||
|
|
||||||
Expect:
|
Expect:
|
||||||
Expected: file:///tmp/junegunn/vim-emoji
|
Expected: file:///tmp/vim-plug-test/junegunn/vim-emoji
|
||||||
Invalid URI: file:///tmp/jg/vim-emoji
|
Invalid URI: file:///tmp/vim-plug-test/jg/vim-emoji
|
||||||
Not found. Try PlugInstall.
|
Not found. Try PlugInstall.
|
||||||
PlugClean required.
|
PlugClean required.
|
||||||
Finished. 2 error(s).
|
Finished. 2 error(s).
|
||||||
@ -300,7 +300,7 @@ Execute (PlugDiff - 'No updates.'):
|
|||||||
Execute (New commits on remote, PlugUpdate, then PlugDiff):
|
Execute (New commits on remote, PlugUpdate, then PlugDiff):
|
||||||
for repo in ['seoul256.vim', 'vim-emoji']
|
for repo in ['seoul256.vim', 'vim-emoji']
|
||||||
for _ in range(2)
|
for _ in range(2)
|
||||||
call system(printf('cd /tmp/junegunn/%s && git commit --allow-empty -m "update"', repo))
|
call system(printf('cd /tmp/vim-plug-test/junegunn/%s && git commit --allow-empty -m "update"', repo))
|
||||||
endfor
|
endfor
|
||||||
endfor
|
endfor
|
||||||
unlet repo
|
unlet repo
|
||||||
@ -596,7 +596,7 @@ Execute (PlugStatus should point out that the plugin is missing):
|
|||||||
Execute (Deploy unmanaged plugin):
|
Execute (Deploy unmanaged plugin):
|
||||||
Assert !exists(':FZF'), ':FZF command should not exist'
|
Assert !exists(':FZF'), ':FZF command should not exist'
|
||||||
call RmRf(fzf)
|
call RmRf(fzf)
|
||||||
Log system(printf('cp -r "/tmp/fzf" "%s"', fzf))
|
Log system(printf('cp -r "/tmp/vim-plug-test/fzf" "%s"', fzf))
|
||||||
|
|
||||||
Execute (PlugUpdate still should not care):
|
Execute (PlugUpdate still should not care):
|
||||||
PlugUpdate
|
PlugUpdate
|
||||||
@ -769,7 +769,7 @@ Execute (On update):
|
|||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
||||||
" New commits on remote
|
" New commits on remote
|
||||||
call system('cd /tmp/junegunn/vim-pseudocl && git commit --allow-empty -m "update"')
|
call system('cd /tmp/vim-plug-test/junegunn/vim-pseudocl && git commit --allow-empty -m "update"')
|
||||||
|
|
||||||
silent PlugUpdate
|
silent PlugUpdate
|
||||||
Log getline(1, '$')
|
Log getline(1, '$')
|
||||||
@ -861,7 +861,7 @@ Execute (Using Funcref):
|
|||||||
Plug 'junegunn/vim-pseudocl', { 'do': function('PlugUpdated') }
|
Plug 'junegunn/vim-pseudocl', { 'do': function('PlugUpdated') }
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
||||||
call system('cd /tmp/junegunn/vim-easy-align && git commit --allow-empty -m "update"')
|
call system('cd /tmp/vim-plug-test/junegunn/vim-easy-align && git commit --allow-empty -m "update"')
|
||||||
call system('cd '.g:plugs['vim-easy-align'].dir.' && git reset --hard HEAD^')
|
call system('cd '.g:plugs['vim-easy-align'].dir.' && git reset --hard HEAD^')
|
||||||
call RmRf(g:plugs['vim-pseudocl'].dir)
|
call RmRf(g:plugs['vim-pseudocl'].dir)
|
||||||
|
|
||||||
@ -921,8 +921,8 @@ Execute (Should not run when failed to update):
|
|||||||
call system(printf('cd %s && git remote set-url origin xxx', g:plugs['vim-easy-align'].dir))
|
call system(printf('cd %s && git remote set-url origin xxx', g:plugs['vim-easy-align'].dir))
|
||||||
|
|
||||||
" New commits on remote
|
" New commits on remote
|
||||||
call system('cd /tmp/junegunn/vim-easy-align && git commit --allow-empty -m "update"')
|
call system('cd /tmp/vim-plug-test/junegunn/vim-easy-align && git commit --allow-empty -m "update"')
|
||||||
call system('cd /tmp/junegunn/vim-pseudocl && git commit --allow-empty -m "update"')
|
call system('cd /tmp/vim-plug-test/junegunn/vim-pseudocl && git commit --allow-empty -m "update"')
|
||||||
|
|
||||||
silent PlugUpdate
|
silent PlugUpdate
|
||||||
Log getline(1, '$')
|
Log getline(1, '$')
|
||||||
@ -940,11 +940,11 @@ Execute (Should not run when failed to update):
|
|||||||
Execute (Using custom dir):
|
Execute (Using custom dir):
|
||||||
Assert isdirectory(g:plugs['vim-easy-align'].dir)
|
Assert isdirectory(g:plugs['vim-easy-align'].dir)
|
||||||
|
|
||||||
call RmRf('/tmp/easy-align')
|
call RmRf('/tmp/vim-plug-test/easy-align')
|
||||||
call plug#begin()
|
call plug#begin()
|
||||||
Plug 'junegunn/vim-easy-align', { 'dir': '/tmp/easy-align' }
|
Plug 'junegunn/vim-easy-align', { 'dir': '/tmp/vim-plug-test/easy-align' }
|
||||||
call plug#end()
|
call plug#end()
|
||||||
AssertEqual '/tmp/easy-align/', g:plugs['vim-easy-align'].dir
|
AssertEqual '/tmp/vim-plug-test/easy-align/', g:plugs['vim-easy-align'].dir
|
||||||
|
|
||||||
PlugClean!
|
PlugClean!
|
||||||
Assert !isdirectory(g:plugs['vim-easy-align'].dir)
|
Assert !isdirectory(g:plugs['vim-easy-align'].dir)
|
||||||
@ -1424,10 +1424,10 @@ Execute (#371 - 'as' option):
|
|||||||
Assert g:plugs.yogo.dir =~# '/yogo/$'
|
Assert g:plugs.yogo.dir =~# '/yogo/$'
|
||||||
|
|
||||||
call plug#begin()
|
call plug#begin()
|
||||||
Plug 'junegunn/goyo.vim', {'as': 'yogo', 'dir': '/tmp/gogo'}
|
Plug 'junegunn/goyo.vim', {'as': 'yogo', 'dir': '/tmp/vim-plug-test/gogo'}
|
||||||
call plug#end()
|
call plug#end()
|
||||||
AssertEqual ['yogo'], sort(keys(g:plugs))
|
AssertEqual ['yogo'], sort(keys(g:plugs))
|
||||||
AssertEqual '/tmp/gogo/', g:plugs.yogo.dir
|
AssertEqual '/tmp/vim-plug-test/gogo/', g:plugs.yogo.dir
|
||||||
|
|
||||||
Execute (#427 - Tag option with wildcard (requires git 1.9.2 or above)):
|
Execute (#427 - Tag option with wildcard (requires git 1.9.2 or above)):
|
||||||
if str2nr(split(split(system('git --version'))[-1], '\.')[0]) < 2
|
if str2nr(split(split(system('git --version'))[-1], '\.')[0]) < 2
|
||||||
|
Loading…
Reference in New Issue
Block a user