]> Cypherpunks repositories - gostls13.git/commit
cmd/vet: add a check for tests with malformed names
authorCatalin Nicutar <cnicutar@google.com>
Sun, 21 Feb 2016 18:32:25 +0000 (18:32 +0000)
committerRob Pike <r@golang.org>
Wed, 24 Feb 2016 10:40:34 +0000 (10:40 +0000)
commit6e6637bdb478e98d32dd10659ea1975a00aeda0a
treec04f4c9c5fcb0ee6a6690b8f489876b306c7600e
parentc3ecded729214abf8a146902741cd6f9d257f68c
cmd/vet: add a check for tests with malformed names

According to golang.org/pkg/testing the first character after Test has
to be non-lowercase. Functions that don't conform to this are not
considered tests and are not loaded which can cause surprises.

This change adds a check to warn about Test-like functions in a _test
file that are not actually run by go test.

Moved over from https://go-review.googlesource.com/#/c/19466/

Change-Id: I2f89676058b27a0e35f721bdabc9fa8a9d34430d
Reviewed-on: https://go-review.googlesource.com/19724
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
src/cmd/vet/doc.go
src/cmd/vet/example.go [deleted file]
src/cmd/vet/testdata/tests_test.go [moved from src/cmd/vet/testdata/examples_test.go with 59% similarity]
src/cmd/vet/tests.go [new file with mode: 0644]