internal

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Regexp added in v0.0.2

func Regexp(res ...*regexp.Regexp) expect.ExpectOpt

Regexp adds an Expect condition to exit if the content read from Console'S tty matches the given Regexp.

func String

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

String adds an Expect condition to exit if the content read from Console'S tty contains any of the given strings. Matched against Console contents with ansi characters stripped.

Types

type AnyMatcher added in v0.0.4

type AnyMatcher struct {
	Matchers []expect.Matcher
}

AnyMatcher collects multiple matchers to be evaluated as a single unit via Console.Expect

func (AnyMatcher) Criteria added in v0.0.4

func (a AnyMatcher) Criteria() interface{}

func (AnyMatcher) Match added in v0.0.4

func (a AnyMatcher) Match(v interface{}) bool

type EOFMatcher added in v0.0.4

type EOFMatcher struct{}

EOFMatcher matches if the character evaluated is io.EOF

func (EOFMatcher) Criteria added in v0.0.4

func (e EOFMatcher) Criteria() interface{}

func (EOFMatcher) Match added in v0.0.4

func (e EOFMatcher) Match(v interface{}) bool

type FlushMatcher

type FlushMatcher struct{}

FlushMatcher fulfills the matcher interface, allowing for a flush of go-expect's internal buffer (forces write to vtx10 terminal). Functionally, it matches nothing until the end of the stream or a timeout, whichever comes first

func (FlushMatcher) Criteria

func (f FlushMatcher) Criteria() interface{}

func (FlushMatcher) Match

func (f FlushMatcher) Match(v interface{}) bool

type PlainStringMatcher

type PlainStringMatcher struct {
	S string
}

PlainStringMatcher fulfills the Matcher interface against strings without ansi codes This is nearly the same as https://github.com/Netflix/go-expect/blob/73e0943537d2ba88bdf3f6acec79ca2de1d059df/expect_opt.go#L160 but differs in that it also escapes ANSI in the buffer to match against plain text

func (PlainStringMatcher) Criteria

func (w PlainStringMatcher) Criteria() interface{}

func (PlainStringMatcher) Match

func (w PlainStringMatcher) Match(v interface{}) bool

type RegexpMatcher added in v0.0.2

type RegexpMatcher struct {
	Re *regexp.Regexp
}

RegexpMatcher fulfills the Matcher interface to match Regexp against a given bytes.Buffer. This is nearly the same as https://github.com/Netflix/go-expect/blob/73e0943537d2ba88bdf3f6acec79ca2de1d059df/expect_opt.go#L181 but differs in that it also escapes ANSI in the buffer to match against plain text

func (*RegexpMatcher) Criteria added in v0.0.2

func (rm *RegexpMatcher) Criteria() interface{}

func (*RegexpMatcher) Match added in v0.0.2

func (rm *RegexpMatcher) Match(v interface{}) bool

Jump to

Keyboard shortcuts

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