Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Expectation ¶
type LogHarness ¶
type LogHarness struct {
// contains filtered or unexported fields
}
A LogHarness runs sets of assertions against the log output of a function. Assertions are grouped into sequences of messages that are expected to be found in the log output. Calling one of the Expect methods on the harness adds an expectation to the default sequence of messages. Additional sequences can be created by calling NewSequence.
func (*LogHarness) Expect ¶
func (h *LogHarness) Expect(s string)
Expect adds an expectation to the default sequence that the log contains a line equal to s
func (*LogHarness) ExpectPrefix ¶
func (h *LogHarness) ExpectPrefix(s string)
ExpectPrefix adds an to the default sequence expectation that the log contains a line starting with s
func (*LogHarness) NewSequence ¶
func (h *LogHarness) NewSequence(name string) *Sequence
NewSequence creates a new sequence of expected log messages
func (*LogHarness) Run ¶
func (h *LogHarness) Run(t *testing.T, f func())
Run executes the function f and captures any output written using Go's standard log. Each sequence of expected messages is then