ptytest

package
v0.27.3 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: AGPL-3.0 Imports: 18 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 (*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 (e *PTY) ExpectMatch(str string) string

func (*PTY) ExpectMatchContext added in v0.15.0

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

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

func (*PTY) ExpectNoMatchBefore added in v0.25.0

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

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

func (*PTY) Peek added in v0.15.0

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

func (*PTY) ReadLine added in v0.13.4

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

func (*PTY) ReadRune added in v0.15.0

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

func (*PTY) Write

func (p *PTY) Write(r rune)

func (*PTY) WriteLine

func (p *PTY) WriteLine(str string)

type PTYCmd added in v0.23.0

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

func Start

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

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

func (*PTYCmd) Close added in v0.23.0

func (p *PTYCmd) Close() error

func (*PTYCmd) ExpectMatch added in v0.23.0

func (e *PTYCmd) ExpectMatch(str string) string

func (*PTYCmd) ExpectMatchContext added in v0.23.0

func (e *PTYCmd) ExpectMatchContext(ctx context.Context, str string) string

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

func (*PTYCmd) ExpectNoMatchBefore added in v0.25.0

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

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

func (*PTYCmd) Peek added in v0.23.0

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

func (*PTYCmd) ReadLine added in v0.23.0

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

func (*PTYCmd) ReadRune added in v0.23.0

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

Jump to

Keyboard shortcuts

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

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy