documentation

g-counter
Jordan Orelli 4 years ago
parent 7bbaa6d8ed
commit 6f26a9018c

@ -6,10 +6,17 @@ import (
"testing" "testing"
) )
// Test is a test value: a value that, given an instance of a testing.T, can be
// used to execute a single test.
type Test interface { type Test interface {
Run(*testing.T) Run(*testing.T)
} }
// After defines the interface used for performing test cleanup. If a Test
// value also implements After, that test's After method will be called after
// all tests are run. Tests in a sequence will have their After methods called
// in the reverse order of their Run methods; a test always runs its After
// method after all of its children have completed their own After methods.
type After interface { type After interface {
After(*testing.T) After(*testing.T)
} }

@ -75,7 +75,10 @@ func New(test Test) *Tree {
} }
} }
// Tree represents a node in a Tree of tests // Tree represents a node in a Tree of tests. Callers create Tree elements in
// one of two ways: by calling New to create a new Tree with the provided test
// as its root, or by calling the Child method on an existing Tree to add a
// child node to the tree.
type Tree struct { type Tree struct {
test Test test Test
name string name string

Loading…
Cancel
Save