Add tests
This commit is contained in:
parent
b6dd24a45f
commit
7a0f21ceeb
5
test/run
5
test/run
|
@ -91,6 +91,11 @@ DOC
|
|||
echo "echomsg 'ftplugin-c'" > "$PLUG_FIXTURES/ftplugin-msg/ftplugin/c.vim"
|
||||
echo "echomsg 'ftplugin-java'" > "$PLUG_FIXTURES/ftplugin-msg/ftplugin/java.vim"
|
||||
|
||||
chmod +w "$PLUG_FIXTURES/cant-delete/autoload" || rm -rf "$PLUG_FIXTURES/cant-delete"
|
||||
mkdir -p "$PLUG_FIXTURES/cant-delete/autoload"
|
||||
touch "$PLUG_FIXTURES/cant-delete/autoload/cant-delete.vim"
|
||||
chmod -w "$PLUG_FIXTURES/cant-delete/autoload"
|
||||
|
||||
rm -rf $TEMP/new-branch
|
||||
cd $TEMP
|
||||
git init new-branch
|
||||
|
|
|
@ -1468,6 +1468,7 @@ Execute (PlugClean should not try to remove unmanaged plugins inside g:plug_home
|
|||
Plug '$PLUG_FIXTURES/fzf'
|
||||
Plug '$PLUG_FIXTURES/xxx'
|
||||
Plug '$PLUG_FIXTURES/yyy'
|
||||
Plug '$PLUG_FIXTURES/cant-delete'
|
||||
call plug#end()
|
||||
|
||||
" Remove z1, z2
|
||||
|
@ -1721,3 +1722,25 @@ Execute (#766 - Allow cloning into an empty directory):
|
|||
AssertExpect! '[=]', 1
|
||||
q
|
||||
unlet d
|
||||
|
||||
Execute (#982 - PlugClean should report when directories cannot be removed):
|
||||
call plug#begin('$PLUG_FIXTURES')
|
||||
Plug '$PLUG_FIXTURES/ftplugin-msg', { 'for': [] }
|
||||
Plug '$PLUG_FIXTURES/fzf'
|
||||
Plug '$PLUG_FIXTURES/xxx'
|
||||
Plug '$PLUG_FIXTURES/yyy'
|
||||
call plug#end()
|
||||
|
||||
" Fail to remove cant-delete
|
||||
PlugClean!
|
||||
AssertEqual 'Removed 0 directories. Failed to remove 1 directories.', getline(4)
|
||||
AssertExpect '^x ', 1
|
||||
q
|
||||
|
||||
" Delete tmp but fail to remove cant-delete
|
||||
call mkdir(expand('$PLUG_FIXTURES/tmp'))
|
||||
PlugClean!
|
||||
AssertEqual 'Removed 1 directories. Failed to remove 1 directories.', getline(4)
|
||||
AssertExpect '^x ', 1
|
||||
AssertExpect '^\~ ', 1
|
||||
q
|
||||
|
|
Loading…
Reference in New Issue
Block a user