structmatcher

package
v1.0.17 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpectStructsToMatch deprecated

func ExpectStructsToMatch(expected interface{}, actual interface{})

Deprecated: Use structmatcher.MatchStruct() GomegaMatcher

func ExpectStructsToMatchExcluding deprecated

func ExpectStructsToMatchExcluding(expected interface{}, actual interface{}, excludeFields ...string)

Deprecated: Use structmatcher.MatchStruct().ExcludingFields() GomegaMatcher

func ExpectStructsToMatchIncluding deprecated

func ExpectStructsToMatchIncluding(expected interface{}, actual interface{}, includeFields ...string)

Deprecated: Use structmatcher.MatchStruct().IncludingFields() GomegaMatcher

func StructMatcher

func StructMatcher(expected, actual interface{}, shouldFilter bool, filterInclude bool, filterFields ...string) []string

* If fields are to be filtered in or out, set shouldFilter to true; filterInclude is true to * include fields or false to exclude fields, and filterFields contains the field names to filter on. * To filter on a field "fieldname" in struct "structname", pass in "fieldname". * To filter on a field "fieldname" in a nested struct under field "structfield", pass in "structfield.fieldname". * This function assumes structs will only ever be nested one level deep.

Types

type Matcher added in v1.0.2

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

func MatchStruct added in v1.0.2

func MatchStruct(expected interface{}) *Matcher

func (*Matcher) ExcludingFields added in v1.0.2

func (m *Matcher) ExcludingFields(fields ...string) *Matcher

func (*Matcher) FailureMessage added in v1.0.2

func (m *Matcher) FailureMessage(actual interface{}) (message string)

func (*Matcher) IncludingFields added in v1.0.2

func (m *Matcher) IncludingFields(fields ...string) *Matcher

func (*Matcher) Match added in v1.0.2

func (m *Matcher) Match(actual interface{}) (success bool, err error)

func (*Matcher) NegatedFailureMessage added in v1.0.2

func (m *Matcher) NegatedFailureMessage(actual interface{}) (message string)

Jump to

Keyboard shortcuts

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