Documentation
¶
Index ¶
- type PTY
- func (p *PTY) Close() error
- func (e *PTY) ExpectMatch(str string) stringdeprecated
- func (e *PTY) ExpectMatchContext(ctx context.Context, str string) string
- func (e *PTY) ExpectNoMatchBefore(ctx context.Context, match, before string) string
- func (e *PTY) ExpectRegexMatch(str string) string
- func (e *PTY) ExpectRegexMatchContext(ctx context.Context, str string) string
- func (p *PTY) Named(name string) *PTY
- func (e *PTY) Peek(ctx context.Context, n int) []byte
- func (e *PTY) ReadAll() []byte
- func (e *PTY) ReadLine(ctx context.Context) string
- func (e *PTY) ReadRune(ctx context.Context) rune
- func (p *PTY) Write(r rune)
- func (p *PTY) WriteLine(str string)
- type PTYCmd
- func (p *PTYCmd) Close() error
- func (e *PTYCmd) ExpectMatch(str string) stringdeprecated
- func (e *PTYCmd) ExpectMatchContext(ctx context.Context, str string) string
- func (e *PTYCmd) ExpectNoMatchBefore(ctx context.Context, match, before string) string
- func (e *PTYCmd) ExpectRegexMatch(str string) string
- func (e *PTYCmd) ExpectRegexMatchContext(ctx context.Context, str string) string
- func (e *PTYCmd) Peek(ctx context.Context, n int) []byte
- func (e *PTYCmd) ReadAll() []byte
- func (e *PTYCmd) ReadLine(ctx context.Context) string
- func (e *PTYCmd) ReadRune(ctx context.Context) rune
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PTY ¶
PTY wraps a pty.PTY with expect-style output matching for tests.
func (*PTY) ExpectMatch
deprecated
func (*PTY) ExpectMatchContext ¶
ExpectMatchContext reads output until str is found or ctx expires.
func (*PTY) ExpectNoMatchBefore ¶
ExpectNoMatchBefore validates that `match` does not occur before `before`.
func (*PTY) ExpectRegexMatch ¶
ExpectRegexMatch uses a background context with a medium timeout.
func (*PTY) ExpectRegexMatchContext ¶
ExpectRegexMatchContext reads output until pattern matches or ctx expires.
type PTYCmd ¶
PTYCmd wraps a pty.PTYCmd with expect-style output matching for tests.
func Start ¶
Start starts a new process asynchronously and returns a PTYCmd and Process. It kills the process and PTYCmd upon cleanup.
func (*PTYCmd) ExpectMatch
deprecated
func (*PTYCmd) ExpectMatchContext ¶
ExpectMatchContext reads output until str is found or ctx expires.
func (*PTYCmd) ExpectNoMatchBefore ¶
ExpectNoMatchBefore validates that `match` does not occur before `before`.
func (*PTYCmd) ExpectRegexMatch ¶
ExpectRegexMatch uses a background context with a medium timeout.
func (*PTYCmd) ExpectRegexMatchContext ¶
ExpectRegexMatchContext reads output until pattern matches or ctx expires.