Skip to content

Commit

Permalink
do not try to run tests for :GoTestCompile
Browse files Browse the repository at this point in the history
Do not try to run a non-existent test for :GoTestCompile. Instead,
compile tests to a temporary file with `go test -c` in order to avoid
problems that may be caused by runtime errors in an init function when
trying to run a non-existent test.

To avoid the problems that 21376e6
resolved, this change relies on Vim's managing of the temporary
directory instead.
  • Loading branch information
bhcleek committed Oct 18, 2017
1 parent 010d0cc commit 177daa2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions autoload/go/test.vim
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ function! go#test#Test(bang, compile, ...) abort

" don't run the test, only compile it. Useful to capture and fix errors.
if a:compile
" we're going to tell to run a test function that doesn't exist. This
" triggers a build of the test file itself but no tests will run.
call extend(args, ["-run", "499EE4A2-5C85-4D35-98FC-7377CD87F263"])
call extend(args, ["-c", "-o", testfile])
endif

if a:0
Expand Down

0 comments on commit 177daa2

Please sign in to comment.