Fix handling of changed up-to-date msg from Git (#724)
The msg was changed from 'Already up-to-date' to 'Already up to date'.
This commit is contained in:
parent
96375cb7d3
commit
e6a775e0df
3 changed files with 13 additions and 12 deletions
2
plug.vim
2
plug.vim
|
@ -908,7 +908,7 @@ function! s:finish(pull)
|
||||||
call add(msgs, "Press 'R' to retry.")
|
call add(msgs, "Press 'R' to retry.")
|
||||||
endif
|
endif
|
||||||
if a:pull && len(s:update.new) < len(filter(getline(5, '$'),
|
if a:pull && len(s:update.new) < len(filter(getline(5, '$'),
|
||||||
\ "v:val =~ '^- ' && stridx(v:val, 'Already up-to-date') < 0"))
|
\ "v:val =~ '^- ' && v:val !~# 'Already up.to.date'"))
|
||||||
call add(msgs, "Press 'D' to see the updated changes.")
|
call add(msgs, "Press 'D' to see the updated changes.")
|
||||||
endif
|
endif
|
||||||
echo join(msgs, ' ')
|
echo join(msgs, ' ')
|
||||||
|
|
|
@ -37,9 +37,10 @@ Execute (Initialize test environment):
|
||||||
g/^$/d
|
g/^$/d
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! AssertExpect(bang, pat, cnt)
|
function! AssertExpect(bang, pat, cnt, ...)
|
||||||
let op = a:bang ? '==#' : '=~#'
|
let op = a:bang ? '==#' : '=~#'
|
||||||
AssertEqual a:cnt, len(filter(getline(1, '$'), "v:val ".op." '".a:pat."'"))
|
let args = [a:cnt, len(filter(getline(1, '$'), "v:val ".op." '".a:pat."'"))] + a:000
|
||||||
|
call call('vader#assert#equal', args)
|
||||||
endfunction
|
endfunction
|
||||||
command! -nargs=+ -bang AssertExpect call AssertExpect('<bang>' == '!', <args>)
|
command! -nargs=+ -bang AssertExpect call AssertExpect('<bang>' == '!', <args>)
|
||||||
|
|
||||||
|
|
|
@ -328,7 +328,7 @@ Execute (PlugUpdate to install both again):
|
||||||
|
|
||||||
Execute (PlugUpdate only to find out plugins are up-to-date, D key to check):
|
Execute (PlugUpdate only to find out plugins are up-to-date, D key to check):
|
||||||
PlugUpdate
|
PlugUpdate
|
||||||
AssertExpect 'Already up-to-date', 2
|
AssertExpect 'Already up.to.date', 2, 'Expected 2 times "Already up-to-date", but got: '.string(getline(1, '$'))
|
||||||
normal D
|
normal D
|
||||||
AssertEqual '0 plugin(s) updated.', getline(1)
|
AssertEqual '0 plugin(s) updated.', getline(1)
|
||||||
q
|
q
|
||||||
|
@ -1613,21 +1613,21 @@ Execute (#532 - Reuse plug window):
|
||||||
call system(printf('cd "%s" && git commit --allow-empty -m "dummy"', g:plugs['goyo.vim'].dir))
|
call system(printf('cd "%s" && git commit --allow-empty -m "dummy"', g:plugs['goyo.vim'].dir))
|
||||||
|
|
||||||
PlugDiff
|
PlugDiff
|
||||||
AssertEqual 1, winnr()
|
AssertEqual 1, winnr(), 'Current window is #1 after PlugDiff (but is '.winnr().')'
|
||||||
AssertEqual 2, winnr('$')
|
AssertEqual 2, winnr('$'), 'Two windows after PlugDiff (but got '.winnr('$').')'
|
||||||
|
|
||||||
" Open preview window
|
" Open preview window
|
||||||
execute "normal ]]jo"
|
execute "normal ]]jo"
|
||||||
AssertEqual 2, winnr()
|
AssertEqual 2, winnr(), 'Current window is #2 after opening preview (but is '.winnr().')'
|
||||||
AssertEqual 3, winnr('$')
|
AssertEqual 3, winnr('$'), 'Three windows with preview (but got '.winnr('$').')'
|
||||||
|
|
||||||
" Move plug window to the right
|
" Move plug window to the right
|
||||||
wincmd L
|
wincmd L
|
||||||
AssertEqual 3, winnr()
|
AssertEqual 3, winnr(), 'Current window is #3 after moving window (but is '.winnr().')'
|
||||||
AssertEqual 3, winnr('$')
|
AssertEqual 3, winnr('$'), 'Three windows after moving window (but got '.winnr('$').')'
|
||||||
|
|
||||||
" Reuse plug window. Preview window is closed.
|
" Reuse plug window. Preview window is closed.
|
||||||
PlugStatus
|
PlugStatus
|
||||||
AssertEqual 2, winnr()
|
AssertEqual 2, winnr(), 'Current window is #2 after PlugStatus (but is '.winnr().')'
|
||||||
AssertEqual 2, winnr('$')
|
AssertEqual 2, winnr('$'), 'Three windows after PlugStatus (but got '.winnr('$').')'
|
||||||
q
|
q
|
||||||
|
|
Loading…
Reference in a new issue