mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated plugins
This commit is contained in:
@ -81,13 +81,25 @@ function! go#cmd#Build(bang, ...)
|
||||
let &makeprg = default_makeprg
|
||||
endfunction
|
||||
|
||||
function! go#cmd#Test(...)
|
||||
let command = "go test ."
|
||||
if len(a:000)
|
||||
let command = "go test " . expand(a:1)
|
||||
function! go#cmd#Test(compile, ...)
|
||||
let command = "go test "
|
||||
|
||||
" don't run the test, only compile it. Useful to capture and fix errors or
|
||||
" to create a test binary.
|
||||
if a:compile
|
||||
let command .= "-c"
|
||||
endif
|
||||
|
||||
if len(a:000)
|
||||
let command .= expand(a:1)
|
||||
endif
|
||||
|
||||
if a:compile
|
||||
echon "vim-go: " | echohl Identifier | echon "compiling tests ..." | echohl None
|
||||
else
|
||||
echon "vim-go: " | echohl Identifier | echon "testing ..." | echohl None
|
||||
endif
|
||||
|
||||
echon "vim-go: " | echohl Identifier | echon "testing ..." | echohl None
|
||||
redraw
|
||||
let out = go#tool#ExecuteInDir(command)
|
||||
if v:shell_error
|
||||
@ -103,7 +115,12 @@ function! go#cmd#Test(...)
|
||||
else
|
||||
call setqflist([])
|
||||
cwindow
|
||||
echon "vim-go: " | echohl Function | echon "[test] PASS" | echohl None
|
||||
|
||||
if a:compile
|
||||
echon "vim-go: " | echohl Function | echon "[test] SUCCESS" | echohl None
|
||||
else
|
||||
echon "vim-go: " | echohl Function | echon "[test] PASS" | echohl None
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
Reference in New Issue
Block a user