Name: go-expect
Owner: Netflix-Skunkworks
Description: an expect-like golang library to automate control of terminal or console based programs.
Created: 2018-05-14 17:53:19.0
Updated: 2018-05-15 21:52:56.0
Pushed: 2018-05-15 21:52:55.0
Homepage: null
Size: 18
Language: Go
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Package expect provides an expect-like interface to automate control of terminal or console based programs. It is unlike expect and other go expect packages in that it does not spawn or control process lifecycle. This package only interfaces with a stdin and stdout and controls the interaction through those files alone.
rr := NewConsole()
rr != nil {
g.Fatal(err)
r c.Close()
:= exec.Command("prompt")
Stdin = c.Stdin()
Stdout = c.Stdout()
Stderr = c.Stdout()
unc() {
Expect("What is 1+1?")
SendLine("2")
Expect("What is Netflix backwards?")
SendLine("xilfteN")
ExpectEOF()
= cmd.Run()
rr != nil {
g.Fatal(err)