termtest

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

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 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