Просмотр исходного кода

Add test case for g:plug_shallow

Junegunn Choi 10 лет назад
Родитель
Сommit
6677e8bffd
2 измененных файлов с 21 добавлено и 1 удалено
  1. 1 0
      test/regressions.vader
  2. 20 1
      test/workflow.vader

+ 1 - 0
test/regressions.vader

@@ -170,6 +170,7 @@ Execute (#139-3 Should fail when not possible to fast-forward):
     silent %y
     Assert @" =~ 'Not possible to fast-forward', @"
   endfor
+  q
 
 **********************************************************************
 Execute (#145: Merging on-demand loading triggers - cmd):

+ 20 - 1
test/workflow.vader

@@ -1089,10 +1089,29 @@ Execute (#221 Shallow-clone and tag option):
 
   Plug 'junegunn/goyo.vim', { 'tag': '1.5.3' }
   PlugUpdate
+  q
+
   Assert len(split(system('git log --oneline'), '\n')) > 1
   Assert system('git describe --tag') =~ '^1.5.3'
   Assert !filereadable('.git/shallow')
-
   cd -
+
+Execute (#221 Shallow-clone disabled by g:plug_shallow = 0):
+  call plug#begin(temp_plugged)
+  call plug#end()
+  PlugClean!
+
+  let g:plug_shallow = 0
+  call plug#begin(temp_plugged)
+  Plug 'junegunn/goyo.vim'
+  call plug#end()
+  PlugInstall
   q
 
+  execute 'cd' g:plugs['goyo.vim'].dir
+  Assert len(split(system('git log --oneline'), '\n')) > 1, 'not shallow'
+  Assert !filereadable('.git/shallow'), 'not shallow'
+  cd -
+Then:
+  unlet g:plug_shallow
+