console

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Console

type Console struct {
	*expect.Console
	T *testing.T
	// contains filtered or unexported fields
}

func NewConsole

func NewConsole(t *testing.T, w io.Writer) (*Console, error)

NewConsole returns a Console for testing PTY handling. All PTY output will be piped to w.

func (*Console) Close added in v0.3.0

func (c *Console) Close() error

Close the TTY, unblocking all Expect and ExpectEOF calls.

func (*Console) ExpectString

func (c *Console) ExpectString(s string) bool

ExpectString advances the PTY buffer until the given string is found. If not, a test error will be thrown, and returns false.

func (*Console) Run

func (c *Console) Run(f func(c *Console)) <-chan struct{}

func (*Console) SendLine

func (c *Console) SendLine(s string) bool

SendLine writes to the PTY buffer. Blocks until the line is written.

Jump to

Keyboard shortcuts

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