allow underscores in test method names
Fixes #12.
Signed-off-by: David Symonds <dsymonds@golang.org>
diff --git a/lint.go b/lint.go
index 385d96e..613a430 100644
--- a/lint.go
+++ b/lint.go
@@ -242,7 +242,7 @@
}
}
case *ast.FuncDecl:
- if f.isTest() && strings.HasPrefix(v.Name.Name, "Example") {
+ if f.isTest() && (strings.HasPrefix(v.Name.Name, "Example") || strings.HasPrefix(v.Name.Name, "Test")) {
return true
}
check(v.Name, "func")
diff --git a/testdata/5_test.go b/testdata/5_test.go
index af84ba1..af17458 100644
--- a/testdata/5_test.go
+++ b/testdata/5_test.go
@@ -10,5 +10,8 @@
func TestSomething(t *testing.T) {
}
+func TestSomething_suffix(t *testing.T) {
+}
+
func ExampleBuffer_reader() {
}