Skip to content

testing: Improve "testing" package comment for beginners #7361

@cgay

Description

@cgay
Go version: 1.2

The Overview section of the "testing" package docs could benefit from
including this line:

```You write a test by creating a file with a name ending in _test.go that contains
functions named TestXXX with signature func (t *testing.T). The test framework runs each
such function; if the function calls a failure function such as t.Error or t.Fail, the
test is considered to have failed.```

That would help beginners get their bearings. I eventually found that explanation here:
http://golang.org/doc/code.html#Testing

While writing my first tests I was looking around for something like assertEqual et al,
and that would have saved me a little time.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions