Documentation
¶
Index ¶
- type Builder
- func (b *Builder) Build() *Test
- func (b *Builder) WithInput(lines ...string) *Builder
- func (b *Builder) WithInputError(afterLines int, err error) *Builder
- func (b *Builder) WithInputReader(reader stream.LineReader) *Builder
- func (b *Builder) WithOutputError(afterWrites int, err error) *Builder
- func (b *Builder) WithStderrError(afterWrites int, err error) *Builder
- type Test
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder constructs test scenarios fluently.
func (*Builder) WithInputError ¶
WithInputError injects a read error after reading N lines.
func (*Builder) WithInputReader ¶
func (b *Builder) WithInputReader(reader stream.LineReader) *Builder
WithInputReader sets a custom input reader.
func (*Builder) WithOutputError ¶
WithOutputError injects a write error on stdout after N writes.
type Test ¶
type Test struct {
Input stream.LineReader
Stdout capture.OutputFunc
Stderr capture.OutputFunc
// Captured outputs for verification
StdoutBuffer *capture.Buffer
StderrBuffer *capture.Buffer
}
Test represents a complete test scenario with input, output, and error handling. Use Builder to construct test scenarios fluently.
Click to show internal directories.
Click to hide internal directories.