diff --git a/test.go b/test.go index b1fc665..58cfbde 100644 --- a/test.go +++ b/test.go @@ -6,10 +6,17 @@ import ( "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 { 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 { After(*testing.T) } diff --git a/tree.go b/tree.go index 82e8b5b..222aa6d 100644 --- a/tree.go +++ b/tree.go @@ -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 { test Test name string