Documentation ¶
Overview ¶
Package assertions contains custom assertions compatible with github.com/smarty/assertions.
Index ¶
- func ShouldBeProperSupersetOfElementsFunc(actual any, expected ...any) (message string)
- func ShouldEqualErrorOrDefinition(actual any, expected ...any) string
- func ShouldHaveEmptyDiff(actual any, expected ...any) (message string)
- func ShouldHaveParentContext(actual any, expected ...any) string
- func ShouldHaveParentContextOrEqual(actual any, expected ...any) string
- func ShouldHaveSameElementsDeep(actual any, expected ...any) (message string)
- func ShouldHaveSameElementsDiff(actual any, expected ...any) (message string)
- func ShouldHaveSameElementsEvent(actual any, expected ...any) (message string)
- func ShouldHaveSameElementsFunc(actual any, expected ...any) (message string)
- func ShouldHaveSameErrorDefinitionAs(actual any, expected ...any) string
- func ShouldNotHaveEmptyDiff(actual any, expected ...any) (message string)
- func ShouldNotHaveSameElementsDeep(actual any, expected ...any) (message string)
- func ShouldNotHaveSameElementsDiff(actual any, expected ...any) (message string)
- func ShouldNotHaveSameElementsEvent(actual any, expected ...any) (message string)
- func ShouldNotHaveSameElementsFunc(actual any, expected ...any) (message string)
- func ShouldNotResemble(actual any, expected ...any) string
- func ShouldReceiveEventFunc(actual any, expected ...any) string
- func ShouldReceiveEventResembling(actual any, expected ...any) string
- func ShouldReceiveEventsFunc(actual any, expected ...any) string
- func ShouldReceiveEventsResembling(actual any, expected ...any) string
- func ShouldResemble(actual any, expected ...any) (message string)
- func ShouldResembleEvent(actual any, expected ...any) string
- func ShouldResembleEventBuilder(actual any, expected ...any) string
- func ShouldResembleEventBuilders(actual any, expected ...any) string
- func ShouldResembleFields(actual any, expected ...any) (message string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ShouldBeProperSupersetOfElementsFunc ¶
ShouldBeProperSupersetOfElementsFunc takes as arguments the actual value, a comparison function and the expected value. If the actual value represents a proper superset of expected value under equality given by the comparison function, this function returns an empty string. Otherwise, it returns a string describing the error.
func ShouldEqualErrorOrDefinition ¶
ShouldEqualErrorOrDefinition is used to assert that an error equals the given Error or Definition.
func ShouldHaveEmptyDiff ¶
ShouldHaveEmptyDiff compares the test.Diff of values.
func ShouldHaveParentContext ¶
ShouldHaveParentContext takes as argument a context.Context and context.Context. If the arguments are valid and the actual context has the expected context as parent, this function returns an empty string. Otherwise, it returns a string describing the error.
func ShouldHaveParentContextOrEqual ¶
ShouldHaveParentContextOrEqual takes as argument a context.Context and context.Context. If the arguments are valid and the actual context has the expected context as parent or if they are equal, this function returns an empty string. Otherwise, it returns a string describing the error.
func ShouldHaveSameElementsDeep ¶
ShouldHaveSameElementsDeep takes as arguments the actual value and the expected value. If the actual value equals the expected value using test.DiffEqual, this function returns an empty string. Otherwise, it returns a string describing the error.
func ShouldHaveSameElementsDiff ¶
ShouldHaveSameElementsDiff takes as arguments the actual value and the expected value. If the actual value equals the expected value using test.Diff, this function returns an empty string. Otherwise, it returns a string describing the error.
func ShouldHaveSameElementsEvent ¶
ShouldHaveSameElementsEvent takes as arguments the actual value and the expected value. If the actual value equals the expected value using test.EventEqual, this function returns an empty string. Otherwise, it returns a string describing the error.
func ShouldHaveSameElementsFunc ¶
ShouldHaveSameElementsFunc takes as arguments the actual value, a comparison function and the expected value. If the actual value equals the expected value using the comparison function, this function returns an empty string. Otherwise, it returns a string describing the error.
func ShouldHaveSameErrorDefinitionAs ¶
ShouldHaveSameErrorDefinitionAs is used to assert that an error resembles the given Error or Definition.
func ShouldNotHaveEmptyDiff ¶
ShouldNotHaveEmptyDiff compares the test.Diff of values.
func ShouldNotHaveSameElementsDeep ¶
ShouldNotHaveSameElementsDeep takes as arguments the actual value and the expected value. If the actual value does not equal the expected value using test.DiffEqual, this function returns an empty string. Otherwise, it returns a string describing the error.
func ShouldNotHaveSameElementsDiff ¶
ShouldNotHaveSameElementsDiff takes as arguments the actual value and the expected value. If the actual value does not equal the expected value using test.Diff, this function returns an empty string. Otherwise, it returns a string describing the error.
func ShouldNotHaveSameElementsEvent ¶
ShouldNotHaveSameElementsEvent takes as arguments the actual value and the expected value. If the actual value does not equal the expected value using test.EventEqual, this function returns an empty string. Otherwise, it returns a string describing the error.
func ShouldNotHaveSameElementsFunc ¶
ShouldNotHaveSameElementsFunc takes as arguments the actual value, a comparison function and the expected value. If the actual value does not equal the expected value using the comparison function, this function returns an empty string. Otherwise, it returns a string describing the error.
func ShouldNotResemble ¶ added in v3.25.0
ShouldNotResemble receives exactly two parameters and does an inverse deep equal check (see test.DiffEqual).
func ShouldReceiveEventFunc ¶
ShouldReceiveEventFunc receives 3 parameters. The first being a channel of either events.Event or test.EventPubSubPublishRequest, the second being the equality function of type func(events.Event, events.Event) bool and third being the expected events.Event.
func ShouldReceiveEventResembling ¶
ShouldReceiveEventResembling is like ShouldReceiveEventFunc, but uses same resemblance function as ShouldResembleEvent.
func ShouldReceiveEventsFunc ¶
ShouldReceiveEventsFunc is like ShouldReceiveEventFunc, but allows for several expected events to be specified. Expected events should be passed as variadic parameters, which can be wrapped any collection of events.Event, that test.WrapRanger can range over.
func ShouldReceiveEventsResembling ¶
ShouldReceiveEventsResembling is like ShouldReceiveEventsFunc, but uses same resemblance function as ShouldResembleEvent.
func ShouldResemble ¶
ShouldResemble wraps assertions.ShouldResemble and prepends a diff if assertion fails.
func ShouldResembleEvent ¶
ShouldResembleEvent is used to assert that an events.Event resembles another events.Event.
func ShouldResembleEventBuilder ¶ added in v3.9.0
ShouldResembleEventBuilder is used to assert that an events.Builder resembles another events.Builder.
func ShouldResembleEventBuilders ¶ added in v3.9.0
ShouldResembleEventBuilders is like ShouldResembleEventBuilders, but for events.Builders
func ShouldResembleFields ¶
ShouldResembleFields is same as ShouldResemble, but only compares the specified fields for 2 given SetFielders.
Types ¶
This section is empty.