termtest

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 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

View Source
const (
	KeyEnter  = Key("\r")
	KeyTab    = Key("\t")
	KeyEsc    = Key(string(rune(27)))
	KeyStrC   = Key(string(rune(3)))
	KeyDelete = Key(string(rune(127)))
	KeyUp     = Key("\u001B[A")
	KeyDown   = Key("\u001B[B")
	KeyLeft   = Key("\x1b[D")
	KeyRight  = Key("\x1b[C")
)

Variables

This section is empty.

Functions

func AnsiString added in v1.6.0

func AnsiString(strs ...string) expect.ExpectOpt

func Keys

func Keys(keys ...Key) []string

func RunTerminalTest

func RunTerminalTest(t *testing.T, test func(c *Console), setupFunc func(termutil.Stdio))

RunTerminalTest runs a fake terminal test which catpures all in & output Source: https://github.com/AlecAivazis/survey/blob/master/survey_posix_test.go

Types

type AnsiStringMatcher added in v1.6.0

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

AnsiStringMatcher fulfills the Matcher interface to match strings against a given bytes.Buffer.

func (*AnsiStringMatcher) Criteria added in v1.6.0

func (sm *AnsiStringMatcher) Criteria() interface{}

func (*AnsiStringMatcher) Match added in v1.6.0

func (sm *AnsiStringMatcher) Match(v interface{}) bool

type Console

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

func (*Console) ExpectString

func (c *Console) ExpectString(val string)

func (*Console) Send

func (c *Console) Send(val string)

func (*Console) SendKey

func (c *Console) SendKey(val Key)

type Key

type Key string

func (Key) Str

func (k Key) Str() string

Jump to

Keyboard shortcuts

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