From: Rob Pike Date: Fri, 21 Feb 2014 22:35:54 +0000 (-0800) Subject: testing: improve introduction to package comment X-Git-Tag: go1.3beta1~629 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=f1e4184db62eba7cf1778b3a15251959c3e5adc2;p=gostls13.git testing: improve introduction to package comment Fixes #7361. LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/66910045 --- diff --git a/src/pkg/testing/testing.go b/src/pkg/testing/testing.go index 855f3a9bbe..2e6d55596f 100644 --- a/src/pkg/testing/testing.go +++ b/src/pkg/testing/testing.go @@ -8,9 +8,17 @@ // 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. -// These TestXxx routines should be declared within the package they are testing. // -// Tests and benchmarks may be skipped if not applicable like this: +// Within these functions, use the Error, Fail or related methods to signal failure. +// +// To write a new test suite, create a file whose name ends _test.go that +// contains the TestXxx functions as described here. Put the file in the same +// package as the one being tested. The file will be excluded from regular +// package builds but will be included when the ``go test'' command is run. +// For more detail, run ``go help test'' and ``go help testflag''. +// +// Tests and benchmarks may be skipped if not applicable with a call to +// the Skip method of *T and *B: // func TestTimeConsuming(t *testing.T) { // if testing.Short() { // t.Skip("skipping test in short mode.")