ptytest

package
v0.21.2 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PTY

type PTY struct {
	pty.PTY
	// contains filtered or unexported fields
}

func New

func New(t *testing.T, opts ...pty.Option) *PTY

func Start

func Start(t *testing.T, cmd *exec.Cmd, opts ...pty.StartOption) (*PTY, pty.Process)

Start starts a new process asynchronously and returns a PTY and Process. It kills the process upon cleanup.

func (*PTY) Attach added in v0.21.0

func (p *PTY) Attach(inv *clibase.Invocation) *PTY

func (*PTY) Close added in v0.13.2

func (p *PTY) Close() error

func (*PTY) ExpectMatch

func (p *PTY) ExpectMatch(str string) string

func (*PTY) ExpectMatchContext added in v0.15.0

func (p *PTY) ExpectMatchContext(ctx context.Context, str string) string

TODO(mafredri): Rename this to ExpectMatch when refactoring.

func (*PTY) Peek added in v0.15.0

func (p *PTY) Peek(ctx context.Context, n int) []byte

func (*PTY) ReadLine added in v0.13.4

func (p *PTY) ReadLine(ctx context.Context) string

func (*PTY) ReadRune added in v0.15.0

func (p *PTY) ReadRune(ctx context.Context) rune

func (*PTY) Write

func (p *PTY) Write(r rune)

func (*PTY) WriteLine

func (p *PTY) WriteLine(str string)

Jump to

Keyboard shortcuts

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