structmatcher

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 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

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

func MatchStruct

func MatchStruct(expected interface{}) *Matcher

func (*Matcher) ExcludingFields

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

func (*Matcher) FailureMessage

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

func (*Matcher) IncludingFields

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

func (*Matcher) Match

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

func (*Matcher) NegatedFailureMessage

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