x/tools/gopls: fails to detect tests starting with an underscore #70929
Labels
gopls/analysis
Issues related to running analysis in gopls
gopls
Issues related to the Go language server, gopls.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
What version of Go, VS Code & VS Code Go extension are you using?
Version Information
go version
to get version of Go from the VS Code integrated terminal.gopls -v version
to get version of Gopls from the VS Code integrated terminal.code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders.Go: Locate Configured Go Tools
command.Share the Go related settings you have added/edited
Run
Preferences: Open Settings (JSON)
command to open your settings.json file.Share all the settings with the
go.
or["go"]
orgopls
prefixes.Describe the bug
The new experimental Go Companion tests infrastructure ignores tests whose name (other than the
Test
) prefix starts with an underscore, whilego test
does not.Steps to reproduce the behavior:
Test_foo
go test -v ./...
within that package -- observe the test is runTestX_foo
The
Test_foo
naming pattern in my case came from "generate tests for function" helper for a non-exported method on a non-exported type, so the test name I have isTest_typeName_methodName
Spun out of a prior discussion with @firelizzard18: golang/vscode-go#1636 (comment)
This feels like it might be a bug in gopls, if the extension is just asking it to list discovered tests, but I'm not sure how to confirm that.
Screenshots or recordings
N/A
The text was updated successfully, but these errors were encountered: