expecter

package
v2.37.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2026 License: AGPL-3.0 Imports: 19 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Expecter

type Expecter struct {
	// contains filtered or unexported fields
}

func New

func New(t *testing.T, r io.Reader, name string) *Expecter

func NewAttachedToInvocation

func NewAttachedToInvocation(t *testing.T, invocation *serpent.Invocation) *Expecter

func NewAttachedToSSHSession added in v2.37.0

func NewAttachedToSSHSession(t *testing.T, session *ssh.Session) *Expecter

func NewPiped

func NewPiped(t *testing.T) (*Expecter, io.Writer)

func (*Expecter) Close

func (e *Expecter) Close(reason string)

func (*Expecter) ExpectMatch

func (e *Expecter) ExpectMatch(ctx context.Context, str string) string

func (*Expecter) ExpectNoMatchBefore

func (e *Expecter) ExpectNoMatchBefore(ctx context.Context, match, before string) string

ExpectNoMatchBefore validates that `match` does not occur before `before`.

func (*Expecter) ExpectRegexMatch

func (e *Expecter) ExpectRegexMatch(ctx context.Context, str string) string

func (*Expecter) Logf

func (e *Expecter) Logf(format string, args ...interface{})

func (*Expecter) Peek

func (e *Expecter) Peek(ctx context.Context, n int) []byte

func (*Expecter) ReadAll

func (e *Expecter) ReadAll() []byte

func (*Expecter) ReadLine

func (e *Expecter) ReadLine(ctx context.Context) string

func (*Expecter) ReadRune

func (e *Expecter) ReadRune(ctx context.Context) rune

func (*Expecter) Rename

func (e *Expecter) Rename(name string)

Rename the expecter. Make sure you set this before anything starts writing to the stream, or it may not be named consistently.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL