matcher

package
v0.0.0-...-a7f85cb Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const AnyText = "AnyText"

Variables

This section is empty.

Functions

func StringContains

func StringContains(v1, v2 string) bool

func StringEqual

func StringEqual(v1, v2 string) bool

func StringRegexMatch

func StringRegexMatch(v, expression string) bool

Types

type Matcher

type Matcher func(rawOutput string, parsedOutput *gabs.Container) error

func All

func All(matchers ...Matcher) Matcher

All runs all specified matchers and will fail if one of them fails

func Func

func Func(m func() bool) Matcher

Func a simple matcher that decided based on true/false value of a function if the operation was successful

func JSON

func JSON(matcher func(g *gabs.Container) error) Matcher

JSON parses step output using gabs and calls the matcher function with the result of gabs parsing

func JSONPath

func JSONPath(path, v string, cmp StringCompare) Matcher

func JSONPathContains

func JSONPathContains(path, v string) Matcher

JSONPathContains expects the value of path to contain given string

func JSONPathEqual

func JSONPathEqual(path, v string) Matcher

JSONPathEqual expects the value of path to equal given string

func StepOutputText

func StepOutputText(v string, cmp StringCompare) Matcher

func StepOutputTextContains

func StepOutputTextContains(v string) Matcher

StepOutputTextContains check if step `output` key contains the expected value

func StepOutputTextEqual

func StepOutputTextEqual(v string) Matcher

StepOutputTextEqual check if step `output` key equals the expected value

func StepStatus

func StepStatus(code codes.Code, message, verbose string) Matcher

func Text

func Text(expectedValue string, cmp StringCompare) Matcher

Text comparison

func TextContains

func TextContains(v string) Matcher

TextContains assert text contains v

func TextEqual

func TextEqual(v string) Matcher

TextEqual assert text equals v

type StringCompare

type StringCompare func(v1, v2 string) bool

Jump to

Keyboard shortcuts

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