Skip to content

Commit

Permalink
Fix handling of changed up-to-date msg from Git
Browse files Browse the repository at this point in the history
The msg was changed from 'Already up-to-date' to 'Already up to date'.
  • Loading branch information
blueyed committed Jan 14, 2018
1 parent 96375cb commit b4e6465
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion plug.vim
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ function! s:finish(pull)
call add(msgs, "Press 'R' to retry.")
endif
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.")
endif
echo join(msgs, ' ')
Expand Down
5 changes: 3 additions & 2 deletions test/test.vader
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ Execute (Initialize test environment):
g/^$/d
endfunction

function! AssertExpect(bang, pat, cnt)
function! AssertExpect(bang, pat, cnt, ...)
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
command! -nargs=+ -bang AssertExpect call AssertExpect('<bang>' == '!', <args>)

Expand Down
18 changes: 9 additions & 9 deletions test/workflow.vader
Original file line number Diff line number Diff line change
Expand Up @@ -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):
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
AssertEqual '0 plugin(s) updated.', getline(1)
q
Expand Down Expand Up @@ -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))

PlugDiff
AssertEqual 1, winnr()
AssertEqual 2, winnr('$')
AssertEqual 1, winnr(), 'Current window is #1 after PlugDiff (but is '.winnr().')'
AssertEqual 2, winnr('$'), 'Two windows after PlugDiff (but got '.winnr('$').')'

" Open preview window
execute "normal ]]jo"
AssertEqual 2, winnr()
AssertEqual 3, winnr('$')
AssertEqual 2, winnr(), 'Current window is #2 after opening preview (but is '.winnr().')'
AssertEqual 3, winnr('$'), 'Three windows with preview (but got '.winnr('$').')'

" Move plug window to the right
wincmd L
AssertEqual 3, winnr()
AssertEqual 3, winnr('$')
AssertEqual 3, winnr(), 'Current window is #3 after moving window (but is '.winnr().')'
AssertEqual 3, winnr('$'), 'Three windows after moving window (but got '.winnr('$').')'

" Reuse plug window. Preview window is closed.
PlugStatus
AssertEqual 2, winnr()
AssertEqual 2, winnr('$')
AssertEqual 2, winnr(), 'Current window is #2 after PlugStatus (but is '.winnr().')'
AssertEqual 2, winnr('$'), 'Three windows after PlugStatus (but got '.winnr('$').')'
q

0 comments on commit b4e6465

Please sign in to comment.