From e6a775e0df3180d3cfea55b351aa7b112c58c139 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sun, 4 Mar 2018 05:43:13 +0100 Subject: [PATCH] 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'. --- plug.vim | 2 +- test/test.vader | 5 +++-- test/workflow.vader | 18 +++++++++--------- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/plug.vim b/plug.vim index 143c377..9ebcf53 100644 --- a/plug.vim +++ b/plug.vim @@ -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, ' ') diff --git a/test/test.vader b/test/test.vader index eaa444c..fc84668 100644 --- a/test/test.vader +++ b/test/test.vader @@ -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('' == '!', ) diff --git a/test/workflow.vader b/test/workflow.vader index 8034d2f..b0a43a1 100644 --- a/test/workflow.vader +++ b/test/workflow.vader @@ -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 @@ -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