I resturctured my test TestXXX as an example ExampleXXX. But forgot to remove the argument.
What did you expect to see?
ExampleXXX(t *testing.T) is wrong signature for an example (has *testing.T as an argument),
so it should raise error on go test.
What did you see instead?
It didn't run. Made me assumes the test has successfully finished.
The text was updated successfully, but these errors were encountered:
seankhliao
changed the title
ExampleXXX(t *testing.T) test sliently discarded, instead of raising error
testing: ExampleXXX(t *testing.T) test sliently discarded, instead of raising error
Feb 13, 2021
Yes, go test runs go vet by default. But it only runs it with a limited set of vet tests, ones that are considered to be very reliable when it comes to showing problems. Perhaps we should add this check to that list.
I'll change this issue into a proposal to do that.
ianlancetaylor
changed the title
testing: ExampleXXX(t *testing.T) test sliently discarded, instead of raising error
proposal: cmd/go: add -tests to list of vet checks run by "go test"
Feb 14, 2021
What version of Go are you using (
go version
)?go 1.15.8
What did you do?
I resturctured my test TestXXX as an example ExampleXXX. But forgot to remove the argument.
What did you expect to see?
ExampleXXX(t *testing.T) is wrong signature for an example (has *testing.T as an argument),
so it should raise error on
go test
.What did you see instead?
It didn't run. Made me assumes the test has successfully finished.
The text was updated successfully, but these errors were encountered: