package expect

import "github.com/coreos/etcd/pkg/expect"

Package expect implements a small expect-style interface

Index

Types

type ExpectProcess

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

func NewExpect

func NewExpect(name string, arg ...string) (ep *ExpectProcess, err error)

NewExpect creates a new process for expect testing.

func (*ExpectProcess) Close

func (ep *ExpectProcess) Close() error

Close waits for the expect process to exit.

func (*ExpectProcess) Expect

func (ep *ExpectProcess) Expect(s string) (string, error)

Expect returns the first line containing the given string.

func (*ExpectProcess) ExpectFunc

func (ep *ExpectProcess) ExpectFunc(f func(string) bool) (string, error)

ExpectFunc returns the first line satisfying the function f.

func (*ExpectProcess) LineCount

func (ep *ExpectProcess) LineCount() int

LineCount returns the number of recorded lines since the beginning of the process.

func (*ExpectProcess) Send

func (ep *ExpectProcess) Send(command string) error

func (*ExpectProcess) Signal

func (ep *ExpectProcess) Signal(sig os.Signal) error

Signal sends a signal to the expect process

func (*ExpectProcess) Stop

func (ep *ExpectProcess) Stop() error

Stop kills the expect process and waits for it to exit.

Source Files

expect.go

Version
v3.0.0+incompatible
Published
Jun 30, 2016
Platform
js/wasm
Imports
7 packages
Last checked
7 minutes ago

Tools for package owners.