aboutsummaryrefslogtreecommitdiff
path: root/src/testing/testing.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing/testing.go')
-rw-r--r--src/testing/testing.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/testing/testing.go b/src/testing/testing.go
index 7f78a7caf8..be21d643fd 100644
--- a/src/testing/testing.go
+++ b/src/testing/testing.go
@@ -277,6 +277,8 @@
// os.Exit(m.Run())
// }
//
+// TestMain is a low-level primitive and should not be necessary for casual
+// testing needs, where ordinary test functions suffice.
package testing
import (
@@ -714,6 +716,7 @@ type TB interface {
Log(args ...interface{})
Logf(format string, args ...interface{})
Name() string
+ Setenv(key, value string)
Skip(args ...interface{})
SkipNow()
Skipf(format string, args ...interface{})
@@ -747,7 +750,11 @@ type T struct {
func (c *common) private() {}
-// Name returns the name of the running test or benchmark.
+// Name returns the name of the running (sub-) test or benchmark.
+//
+// The name will include the name of the test along with the names of
+// any nested sub-tests. If two sibling sub-tests have the same name,
+// Name will append a suffix to guarantee the returned name is unique.
func (c *common) Name() string {
return c.name
}