Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Netflix/go-expect
/ functions
Functions
82 in github.com/Netflix/go-expect
⨍
Functions
82
◇
Types & classes
21
↓ 32 callers
Method
Tty
Tty returns Console's pts (slave part of a pty). A pseudoterminal, or pty is a pair of psuedo-devices, one of which, the slave, emulates a real text t
console.go:184
↓ 25 callers
Function
String
String adds an Expect condition to exit if the content read from Console's tty contains any of the given strings.
expect_opt.go:244
↓ 15 callers
Function
testCloser
(t *testing.T, closer io.Closer)
expect_test.go:110
↓ 10 callers
Function
All
All adds an Expect condition to exit if the content read from Console's tty matches all of the provided ExpectOpt, in any order.
expect_opt.go:226
↓ 10 callers
Method
SendLine
SendLine writes string s to Console's tty with a trailing newline.
console.go:227
↓ 9 callers
Method
Close
Close closes Console's tty. Calling Close will unblock Expect and ExpectEOF.
console.go:206
↓ 9 callers
Method
ExpectString
ExpectString reads from Console's tty until the provided string is read or an error occurs, and returns the buffer read by Console.
expect.go:34
↓ 8 callers
Method
Match
Match sequentially calls Match on all matchers in ExpectOpts and returns the first matcher if a match exists, otherwise nil.
expect_opt.go:70
↓ 7 callers
Method
ExpectEOF
ExpectEOF reads from Console's tty until EOF or an error occurs, and returns the buffer read by Console. We also treat the PTSClosed error as an EOF.
expect.go:40
↓ 7 callers
Function
Prompt
(in io.Reader, out io.Writer)
expect_test.go:42
↓ 6 callers
Function
RegexpPattern
RegexpPattern adds an Expect condition to exit if the content read from Console's tty matches the given Regexp patterns. Expect returns an error if th
expect_opt.go:271
↓ 6 callers
Method
Then
Then returns an Expect condition to execute a callback if a match is found for the chained matcher.
expect_opt.go:44
↓ 5 callers
Function
Error
Error adds an Expect condition to exit if reading from Console's tty returns one of the provided errors.
expect_opt.go:287
↓ 5 callers
Method
Expect
Expect reads from Console's tty until a condition specified from opts is encountered or an error occurs, and returns the buffer read by console. No ex
expect.go:50
↓ 5 callers
Method
Logf
Logf prints to Console's logger. Arguments are handled in the manner of fmt.Printf.
console.go:239
↓ 5 callers
Function
Regexp
Regexp adds an Expect condition to exit if the content read from Console's tty matches the given Regexp.
expect_opt.go:257
↓ 5 callers
Function
newTestConsole
(t *testing.T, opts ...ConsoleOpt)
expect_test.go:69
↓ 4 callers
Method
Match
Match returns true iff a match is found.
expect_opt.go:90
↓ 4 callers
Function
NewConsole
NewConsole returns a new Console with the given options.
console.go:137
↓ 4 callers
Method
SetReadDeadline
(t time.Time)
passthrough_pipe.go:93
↓ 3 callers
Method
Callback
Callback executes the matcher's callback with the content buffer at the time of match.
expect_opt.go:83
↓ 3 callers
Method
Criteria
()
expect_opt.go:91
↓ 3 callers
Function
NewPassthroughPipe
NewPassthroughPipe returns a new pipe for a io.Reader that passes through non-timeout errors.
passthrough_pipe.go:33
↓ 3 callers
Method
NewReader
NewReader returns a cancellable io.Reader for the underlying io.Reader. Readers can be cancelled without interrupting other Readers, and once a reader
reader_lease.go:58
↓ 3 callers
Function
NewTestConsole
NewTestConsole returns a new Console that multiplexes the application's stdout to go's testing logger. Primarily so that outputs from parallel tests u
test_log.go:27
↓ 3 callers
Method
Read
(p []byte)
passthrough_pipe.go:69
↓ 3 callers
Method
Send
Send writes string s to Console's tty.
console.go:217
↓ 3 callers
Function
WithDefaultTimeout
WithDefaultTimeout sets a default read timeout during Expect statements.
console.go:129
↓ 3 callers
Function
WithStdout
WithStdout adds writers that Console duplicates writes to, similar to the Unix tee(1) command. Each write is written to each listed writer, one at a
console.go:79
↓ 3 callers
Function
expectNoError
(t *testing.T)
expect_test.go:78
↓ 3 callers
Function
sendNoError
(t *testing.T)
expect_test.go:97
↓ 2 callers
Method
Expectf
Expectf reads from the Console's tty until the provided formatted string is read or an error occurs, and returns the buffer read by Console.
expect.go:28
↓ 2 callers
Function
WithTimeout
WithTimeout sets a read timeout for an Expect statement.
expect_opt.go:31
↓ 2 callers
Method
Write
Write writes bytes b to Console's tty.
console.go:194
↓ 1 callers
Method
Close
()
passthrough_pipe.go:89
↓ 1 callers
Method
Log
Log prints to Console's logger. Arguments are handled in the manner of fmt.Print.
console.go:233
↓ 1 callers
Function
NewChanReader
NewChanReader returns a io.Reader over a byte chan. If context is cancelled, future Reads will return io.EOF.
reader_lease.go:69
↓ 1 callers
Function
NewReaderLease
NewReaderLease returns a new ReaderLease that begins reading the given io.Reader.
reader_lease.go:31
↓ 1 callers
Function
NewTestWriter
NewTestWriter returns an io.Writer where bytes written to the file are logged by go's testing logger. Bytes are flushed to the logger on line end.
test_log.go:38
↓ 1 callers
Method
Read
Read reads bytes b from Console's tty.
console.go:189
↓ 1 callers
Method
Read
(p []byte)
reader_lease.go:76
↓ 1 callers
Function
WithExpectObserver
WithExpectObserver adds an ExpectObserver to allow monitoring Expect operations.
console.go:113
↓ 1 callers
Function
WithSendObserver
WithSendObserver adds a SendObserver to allow monitoring Send operations.
console.go:121
↓ 1 callers
Function
WithStdin
WithStdin adds readers that bytes read are written to Console's tty. If a listed reader returns an error, that reader will not be continued to read.
console.go:88
↓ 1 callers
Method
Write
(p []byte)
test_log.go:68
Method
Callback
(buf *bytes.Buffer)
expect_opt.go:109
Method
Criteria
()
expect_opt.go:105
Method
Criteria
()
expect_opt.go:137
Method
Criteria
()
expect_opt.go:154
Method
Criteria
()
expect_opt.go:175
Method
Criteria
()
expect_opt.go:193
Method
Criteria
()
expect_opt.go:216
Function
EOF
EOF adds an Expect condition to exit if io.EOF is returned from reading Console's tty.
expect_opt.go:300
Function
ExampleConsole_echo
()
expect_test.go:375
Method
Fd
Fd returns Console's file descripting referencing the master part of its pty.
console.go:201
Method
Match
(v interface{})
expect_opt.go:101
Method
Match
(v interface{})
expect_opt.go:129
Method
Match
(v interface{})
expect_opt.go:146
Method
Match
(v interface{})
expect_opt.go:164
Method
Match
(v interface{})
expect_opt.go:185
Method
Match
(v interface{})
expect_opt.go:203
Function
PTSClosed
PTSClosed adds an Expect condition to exit if we get an "read /dev/ptmx: input/output error" error which can occur on Linux while reading from the ptm
expect_opt.go:309
Function
StripTrailingEmptyLines
StripTrailingEmptyLines returns a copy of s stripped of trailing lines that consist of only space characters.
test_log.go:75
Function
TestConsoleChain
(t *testing.T)
expect_test.go:282
Function
TestEditor
(t *testing.T)
expect_test.go:327
Function
TestExpect
(t *testing.T)
expect_test.go:145
Function
TestExpectDefaultTimeout
(t *testing.T)
expect_test.go:200
Function
TestExpectDefaultTimeoutOverride
(t *testing.T)
expect_test.go:252
Function
TestExpectOptAll
(t *testing.T)
expect_opt_test.go:318
Function
TestExpectOptError
(t *testing.T)
expect_opt_test.go:186
Function
TestExpectOptRegexp
(t *testing.T)
expect_opt_test.go:80
Function
TestExpectOptRegexpPattern
(t *testing.T)
expect_opt_test.go:133
Function
TestExpectOptString
(t *testing.T)
expect_opt_test.go:27
Function
TestExpectOptThen
(t *testing.T)
expect_opt_test.go:235
Function
TestExpectOutput
(t *testing.T)
expect_test.go:174
Function
TestExpectTimeout
(t *testing.T)
expect_test.go:226
Function
TestExpectf
(t *testing.T)
expect_test.go:117
Function
TestPassthroughPipe
(t *testing.T)
passthrough_pipe_test.go:13
Function
TestPassthroughPipeTimeout
(t *testing.T)
passthrough_pipe_test.go:31
Function
TestReaderLease
(t *testing.T)
reader_lease_test.go:12
Function
WithCloser
WithCloser adds closers that are closed in order when Console is closed.
console.go:96
Function
WithLogger
WithLogger adds a logger for Console to log debugging information to. By default Console will discard logs.
console.go:105