Documentation
¶
Index ¶
- func WithCaptureAll() func(*options)
- func WithStderrLineContains(lines ...string) func(*options)
- func WithStdoutLineContains(lines ...string) func(*options)
- type LogLine
- func (l *LogLine) Cleanup(t *testing.T)
- func (l *LogLine) Contains(substr string) bool
- func (l *LogLine) EventuallyContains(t assert.TestingT, substr string, timeout time.Duration, tick time.Duration) bool
- func (l *LogLine) EventuallyFoundAll(t *testing.T)
- func (l *LogLine) EventuallyFoundNone(t *testing.T)
- func (l *LogLine) FoundAll() bool
- func (l *LogLine) FoundNone() bool
- func (l *LogLine) Reset()
- func (l *LogLine) Run(t *testing.T, ctx context.Context)
- func (l *LogLine) Stderr() io.WriteCloser
- func (l *LogLine) Stdout() io.WriteCloser
- func (l *LogLine) StdoutBuffer() []byte
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithCaptureAll ¶
func WithCaptureAll() func(*options)
WithCaptureAll enables continuous log capture mode, where all logs are captured to the buffer even without specific expected lines configured. This is useful for tests that need to dynamically check log contents using Contains() or Reset().
func WithStderrLineContains ¶
func WithStderrLineContains(lines ...string) func(*options)
func WithStdoutLineContains ¶
func WithStdoutLineContains(lines ...string) func(*options)
Types ¶
type LogLine ¶
type LogLine struct {
// contains filtered or unexported fields
}
func (*LogLine) Contains ¶ added in v1.17.7
Contains checks if the captured log output contains the given substring. This is useful for dynamic log checking during tests.
func (*LogLine) EventuallyContains ¶
func (l *LogLine) EventuallyContains(t assert.TestingT, substr string, timeout time.Duration, tick time.Duration) bool
EventuallyContains waits for the captured log output to contain the given substring within the specified timeout.
func (*LogLine) EventuallyFoundAll ¶
func (*LogLine) EventuallyFoundNone ¶ added in v1.16.1
func (*LogLine) Reset ¶
func (l *LogLine) Reset()
Reset clears the captured log buffer. This is useful when testing configuration reloads where you want to verify new log output after a reload without interference from previous log entries.
func (*LogLine) Stderr ¶
func (l *LogLine) Stderr() io.WriteCloser
func (*LogLine) Stdout ¶
func (l *LogLine) Stdout() io.WriteCloser