What version of Go are you using (go version)?
1.9.2
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (go env)?
linux amd64
What did you do?
$ cat << EOF > foo_test.go
package foo
import "testing"
func Test_Foo(t *testing.T) {
println("hello")
}
EOF
What did you expect to see?
ok _/some/dir 0.001s [no tests to run]
What did you see instead?
=== RUN Test_Foo
hello
--- PASS: Test_Foo (0.00s)
PASS
ok _/some/dir 0.002s
Official documentation for Go testing package states, that go test
automates execution of any function of the form func TestXxx(*testing.T) where Xxx can be any alphanumeric string (but the first letter must not be in [a-z]) and serves to identify the test routine.
There are tons of open-source go projects that use _ (underscore) in tests names (although all Google projects I've seen so far do follow these naming guidelines), yet _ is not alphanumeric and, according to the documentation, should not work.
I believe either this statement in documentation has to be clarified or go test behavior has to be adjusted to conform to the documentation (unlikely, considering how ubiquitous _ became)
What version of Go are you using (
go version)?1.9.2
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env)?linux amd64
What did you do?
What did you expect to see?
What did you see instead?
Official documentation for Go testing package states, that
go testThere are tons of open-source go projects that use
_(underscore) in tests names (although all Google projects I've seen so far do follow these naming guidelines), yet_is not alphanumeric and, according to the documentation, should not work.I believe either this statement in documentation has to be clarified or
go testbehavior has to be adjusted to conform to the documentation (unlikely, considering how ubiquitous_became)