Closed mpiexec closed 1 year ago
That message indicates that there are no test files in your package.
@bhcleek Ok, but test file main_test.go
is there. These commands complete successfully:
:GoTest
:GoTestCompile
:GoCoverageBrowser
Results:
vim-go: [test] SUCCESS
vim-go: [compile test] SUCCESS
Manually running tests:
~> go test -v
=== RUN Test__sum
--- PASS: Test__sum (0.00s)
PASS
ok mymod 0.258s
Can you run :lcd expand('%:p:h')
? After that, I'd like to know the output of these two commands:
:echo glob('*_test.go')
and :!ls *_test.go
Yep,
:echo glob('*_test.go')
" empty
:!ls *_test.go
" main_test.go
Maybe you mean that:
:echo ('*_test.go')
" *_test.go
The problem seems to be that Vim's glob
function is not matching your test file, but I'm not sure why.
What's the full path to your main_test.go
file?
~> pwd
/Users/grant/tmp/go
~> ll *go
-rw-r--r-- 1 grant staff 712 2023-01-17 17:24 main.go
-rw-r--r-- 1 grant staff 166 2023-01-17 16:11 main_test.go
But it works when I move my project into /Users/grant/go
, strange things
That makes sense. It's because your wildignore
is causing vim's glob()
to ignore everything below a tmp
directory.
It's because your wildignore is causing vim's glob() to ignore everything below a tmp directory.
Bingo! Big thanks
What did you do? (required: The issue will be closed when not provided)
Running
:GoCoverage
shows messagevim-go: no test files available
, at the same time:GoTest
complete successfully with:GoTest
. However:GoCoverageBrowser
working correctly.What did you expect to happen?
vim-go tutorial:
What happened instead?
Configuration (MUST fill this out):
vim-go settings:
vim-go version:
The latest stable release, v1.28
vimrc
you used to reproduce:Vim version (first three lines from
:version
):Go version (
go version
):Go environment
gopls version