matcher

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Text matcher type
	Text = "text"
	// Contains matcher type
	Contains = "contains"
	// Equal matcher type
	Equal = "equal"
	// Not contains matcher type
	NotContains = "notcontains"
	JSON        = "json"
	XML         = "xml"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainsMatcher

type ContainsMatcher struct {
}

ContainsMatcher tests if the expected value is in the got variable

func (ContainsMatcher) Match

func (m ContainsMatcher) Match(got interface{}, expected interface{}) MatcherResult

Match matches on the given values

type EqualMatcher

type EqualMatcher struct {
}

EqualMatcher matches if given values are equal

func (EqualMatcher) Match

func (m EqualMatcher) Match(got interface{}, expected interface{}) MatcherResult

Match matches the values if they are equal

type JSONMatcher added in v1.3.0

type JSONMatcher struct {
}

func (JSONMatcher) Match added in v1.3.0

func (m JSONMatcher) Match(got interface{}, expected interface{}) MatcherResult

type Matcher

type Matcher interface {
	Match(actual interface{}, expected interface{}) MatcherResult
}

Matcher interface which is implemented by all matchers

func NewMatcher

func NewMatcher(matcher string) Matcher

NewMatcher creates a new matcher by type

type MatcherResult

type MatcherResult struct {
	Success bool
	Diff    string
}

MatcherResult will be returned by the executed matcher

type NotContainsMatcher added in v1.1.0

type NotContainsMatcher struct {
}

func (NotContainsMatcher) Match added in v1.1.0

func (m NotContainsMatcher) Match(got interface{}, expected interface{}) MatcherResult

type TextMatcher

type TextMatcher struct {
}

TextMatcher matches if two texts are equals

func (TextMatcher) Match

func (m TextMatcher) Match(got interface{}, expected interface{}) MatcherResult

Match matches both texts

type XMLMatcher added in v1.3.0

type XMLMatcher struct {
}

func (XMLMatcher) Match added in v1.3.0

func (m XMLMatcher) Match(got interface{}, expected interface{}) MatcherResult

Jump to

Keyboard shortcuts

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