|
|
@@ -72,3 +72,80 @@ Execute (#131 Syntax error):
|
|
|
silent PlugInstall
|
|
|
redir END
|
|
|
Assert out =~ 'Invalid plug directory: /no-permission'
|
|
|
+
|
|
|
+**********************************************************************
|
|
|
+Execute (#139-1 Using new remote branch):
|
|
|
+ " Make sure to remove the clone
|
|
|
+ call plug#begin('$TMPDIR/plugged')
|
|
|
+ call plug#end()
|
|
|
+ PlugClean!
|
|
|
+
|
|
|
+ " Install master branch
|
|
|
+ call plug#begin('$TMPDIR/plugged')
|
|
|
+ Plug expand('file:///$TMPDIR/new-branch')
|
|
|
+ call plug#end()
|
|
|
+ PlugUpdate
|
|
|
+
|
|
|
+ unlet! g:foo g:bar g:baz
|
|
|
+ call plug#load('new-branch')
|
|
|
+ Assert exists('g:foo'), 'g:foo should be found'
|
|
|
+ Assert !exists('g:bar'), 'g:bar should not be found'
|
|
|
+ Assert !exists('g:baz'), 'g:baz should not be found'
|
|
|
+
|
|
|
+ " Create a new branch on origin
|
|
|
+ call system('cd $TMPDIR/new-branch && git checkout -b new &&'
|
|
|
+ \. 'echo "let g:bar = 1" > plugin/bar.vim && git add plugin/bar.vim &&'
|
|
|
+ \. 'git commit -m second')
|
|
|
+
|
|
|
+ " We're setting up two plugins so that parallel installer is used
|
|
|
+ call plug#begin('$TMPDIR/plugged')
|
|
|
+ Plug 'junegunn/seoul256.vim'
|
|
|
+ Plug expand('file:///$TMPDIR/new-branch'), 'new'
|
|
|
+ call plug#end()
|
|
|
+ PlugUpdate
|
|
|
+ silent %y
|
|
|
+ Log @"
|
|
|
+ Assert @" !~? 'error', 'Should be able to use new remote branch: ' . @"
|
|
|
+
|
|
|
+ unlet! g:foo g:bar g:baz
|
|
|
+ call plug#load('new-branch')
|
|
|
+ Assert exists('g:foo'), 'g:foo should be found'
|
|
|
+ Assert exists('g:bar'), 'g:bar should be found'
|
|
|
+ Assert !exists('g:baz'), 'g:baz should not be found'
|
|
|
+
|
|
|
+ call PlugStatusSorted()
|
|
|
+
|
|
|
+Expect:
|
|
|
+ - new-branch: OK
|
|
|
+ - seoul256.vim: OK
|
|
|
+ Finished. 0 error(s).
|
|
|
+ [==]
|
|
|
+
|
|
|
+Execute (#139-2 Using yet another new remote branch):
|
|
|
+ " Create another branch on origin
|
|
|
+ call system('cd $TMPDIR/new-branch && git checkout master &&'
|
|
|
+ \. 'git checkout -b brand-new &&'
|
|
|
+ \. 'echo "let g:baz = 1" > plugin/baz.vim && git add plugin/baz.vim &&'
|
|
|
+ \. 'git commit -m thirf')
|
|
|
+
|
|
|
+ " Test Vim installer here
|
|
|
+ call plug#begin('$TMPDIR/plugged')
|
|
|
+ Plug expand('file:///$TMPDIR/new-branch'), 'brand-new'
|
|
|
+ call plug#end()
|
|
|
+ PlugUpdate
|
|
|
+ silent %y
|
|
|
+ Log @"
|
|
|
+ Assert @" !~? 'error', 'Should be able to use new remote branch: ' . @"
|
|
|
+
|
|
|
+ unlet! g:foo g:bar g:baz
|
|
|
+ call plug#load('new-branch')
|
|
|
+ Assert exists('g:foo'), 'g:foo should be found'
|
|
|
+ Assert !exists('g:bar'), 'g:bar should not be found'
|
|
|
+ Assert exists('g:baz'), 'g:baz should be found'
|
|
|
+
|
|
|
+ call PlugStatusSorted()
|
|
|
+
|
|
|
+Expect:
|
|
|
+ - new-branch: OK
|
|
|
+ Finished. 0 error(s).
|
|
|
+ [=]
|