Documentation
¶
Index ¶
- func BetweenExclusive[T cmp.Ordered](t TestingT, actual, lower, upper T) bool
- func BetweenInclusive[T cmp.Ordered](t TestingT, actual, lower, upper T) bool
- func ContainedIn[T comparable, S ~[]T](t TestingT, actual T, expected S) bool
- func ContainedInEntries[K, V comparable, M ~map[K]V](t TestingT, actualKey K, actualValue V, expected M) bool
- func ContainedInKeys[K comparable, V any, M ~map[K]V](t TestingT, actual K, expected M) bool
- func ContainedInValues[K, V comparable, M ~map[K]V](t TestingT, actual V, expected M) bool
- func Contains[T comparable, S ~[]T](t TestingT, actual S, expected T) bool
- func ContainsEntry[K, V comparable, M ~map[K]V](t TestingT, actual M, expectedKey K, expectedValue V) bool
- func ContainsKey[K comparable, V any, M ~map[K]V](t TestingT, actual M, expected K) bool
- func ContainsValue[K, V comparable, M ~map[K]V](t TestingT, actual M, expected V) bool
- func DeepEqual(t TestingT, actual, expected any) bool
- func Equal[T comparable](t TestingT, actual, expected T) bool
- func ErrorIs(t TestingT, actual, expected error) bool
- func ErrorMessageIs(t TestingT, actual error, expected string) bool
- func False(t TestingT, actual bool) bool
- func GreaterThan[T cmp.Ordered](t TestingT, actual, expected T) bool
- func GreaterThanOrEqual[T cmp.Ordered](t TestingT, actual, expected T) bool
- func LessThan[T cmp.Ordered](t TestingT, actual, expected T) bool
- func LessThanOrEqual[T cmp.Ordered](t TestingT, actual, expected T) bool
- func MapEmpty[K comparable, V any, M ~map[K]V](t TestingT, actual M) bool
- func MapLen[K comparable, V any, M ~map[K]V](t TestingT, actual M, expected int) bool
- func Match[Actual any](t TestingT, actual Actual, matcher Matcher[Actual]) bool
- func Must[T any](t TestingT, f func() (T, error)) T
- func MustNoError(t TestingT, err error)
- func Nil(t TestingT, actual any) bool
- func NoError(t TestingT, err error) bool
- func NotContainedIn[T comparable, S ~[]T](t TestingT, actual T, expected S) bool
- func NotContainedInEntries[K, V comparable, M ~map[K]V](t TestingT, actualKey K, actualValue V, expected M) bool
- func NotContainedInKeys[K comparable, V any, M ~map[K]V](t TestingT, actual K, expected M) bool
- func NotContainedInValues[K, V comparable, M ~map[K]V](t TestingT, actual V, expected M) bool
- func NotContains[T comparable, S ~[]T](t TestingT, actual S, expected T) bool
- func NotContainsEntry[K, V comparable, M ~map[K]V](t TestingT, actual M, expectedKey K, expectedValue V) bool
- func NotContainsKey[K comparable, V any, M ~map[K]V](t TestingT, actual M, expected K) bool
- func NotContainsValue[K, V comparable, M ~map[K]V](t TestingT, actual M, expected V) bool
- func NotDeepEqual(t TestingT, actual, expected any) bool
- func NotEqual[T comparable](t TestingT, actual, expected T) bool
- func NotErrorIs(t TestingT, actual, expected error) bool
- func NotErrorMessageIs(t TestingT, actual error, expected string) bool
- func NotMapEmpty[K comparable, V any, M ~map[K]V](t TestingT, actual M) bool
- func NotNil(t TestingT, actual any) bool
- func NotRegexpMatch(t TestingT, actual string, expected *regexp.Regexp) bool
- func NotSliceEmpty[T any, S ~[]T](t TestingT, actual S) bool
- func NotZero(t TestingT, actual any) bool
- func RegexpMatch(t TestingT, actual string, expected *regexp.Regexp) bool
- func SliceEmpty[T any, S ~[]T](t TestingT, actual S) bool
- func SliceLen[T any, S ~[]T](t TestingT, actual S, expected int) bool
- func True(t TestingT, actual bool) bool
- func Zero(t TestingT, actual any) bool
- type Matcher
- type MatcherFunc
- type TestingT
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BetweenExclusive ¶ added in v0.1.4
BetweenExclusive asserts that a value is between two values (exclusive).
func BetweenInclusive ¶ added in v0.1.4
BetweenInclusive asserts that a value is between two values (inclusive).
func ContainedIn ¶ added in v0.1.5
func ContainedIn[T comparable, S ~[]T](t TestingT, actual T, expected S) bool
ContainedIn asserts that an element is contained in a slice.
func ContainedInEntries ¶ added in v0.1.5
func ContainedInEntries[K, V comparable, M ~map[K]V](t TestingT, actualKey K, actualValue V, expected M) bool
ContainedInEntries asserts that a key-value pair is contained in a map.
func ContainedInKeys ¶ added in v0.1.5
func ContainedInKeys[K comparable, V any, M ~map[K]V](t TestingT, actual K, expected M) bool
ContainedInKeys asserts that a key is contained in a map.
func ContainedInValues ¶ added in v0.1.5
func ContainedInValues[K, V comparable, M ~map[K]V](t TestingT, actual V, expected M) bool
ContainedInValues asserts that a value is contained in a map.
func Contains ¶ added in v0.1.4
func Contains[T comparable, S ~[]T](t TestingT, actual S, expected T) bool
Contains asserts that a slice contains an expected element.
func ContainsEntry ¶ added in v0.1.4
func ContainsEntry[K, V comparable, M ~map[K]V](t TestingT, actual M, expectedKey K, expectedValue V) bool
ContainsEntry asserts that a map contains an expected key-value pair.
func ContainsKey ¶ added in v0.1.4
func ContainsKey[K comparable, V any, M ~map[K]V](t TestingT, actual M, expected K) bool
ContainsKey asserts that a map contains an expected key.
func ContainsValue ¶ added in v0.1.4
func ContainsValue[K, V comparable, M ~map[K]V](t TestingT, actual M, expected V) bool
ContainsValue asserts that a map contains an expected value.
func Equal ¶
func Equal[T comparable](t TestingT, actual, expected T) bool
Equal asserts that two comparable values are equal.
func ErrorMessageIs ¶ added in v0.1.4
ErrorMessageIs asserts that an error's message matches the expected string.
func GreaterThan ¶ added in v0.1.4
GreaterThan asserts that a value is greater than another value.
func GreaterThanOrEqual ¶ added in v0.1.4
GreaterThanOrEqual asserts that a value is greater than or equal to another value.
func LessThanOrEqual ¶ added in v0.1.4
LessThanOrEqual asserts that a value is less than or equal to another value.
func MapEmpty ¶ added in v0.1.6
func MapEmpty[K comparable, V any, M ~map[K]V](t TestingT, actual M) bool
func MapLen ¶ added in v0.1.6
func MapLen[K comparable, V any, M ~map[K]V](t TestingT, actual M, expected int) bool
func Must ¶
Must runs a function that returns a value and error, fails immediately if error is not nil.
func MustNoError ¶
MustNoError fails the test immediately if the error is not nil.
func NotContainedIn ¶ added in v0.1.5
func NotContainedIn[T comparable, S ~[]T](t TestingT, actual T, expected S) bool
NotContainedIn asserts that an element is not contained in a slice.
func NotContainedInEntries ¶ added in v0.1.5
func NotContainedInEntries[K, V comparable, M ~map[K]V](t TestingT, actualKey K, actualValue V, expected M) bool
NotContainedInEntries asserts that a key-value pair is not contained in a map.
func NotContainedInKeys ¶ added in v0.1.5
func NotContainedInKeys[K comparable, V any, M ~map[K]V](t TestingT, actual K, expected M) bool
NotContainedInKeys asserts that a key is not contained in a map.
func NotContainedInValues ¶ added in v0.1.5
func NotContainedInValues[K, V comparable, M ~map[K]V](t TestingT, actual V, expected M) bool
NotContainedInValues asserts that a value is not contained in a map.
func NotContains ¶ added in v0.1.4
func NotContains[T comparable, S ~[]T](t TestingT, actual S, expected T) bool
NotContains asserts that a slice does not contain an expected element.
func NotContainsEntry ¶ added in v0.1.4
func NotContainsEntry[K, V comparable, M ~map[K]V](t TestingT, actual M, expectedKey K, expectedValue V) bool
NotContainsEntry asserts that a map does not contain an expected key-value pair.
func NotContainsKey ¶ added in v0.1.4
func NotContainsKey[K comparable, V any, M ~map[K]V](t TestingT, actual M, expected K) bool
NotContainsKey asserts that a map does not contain an expected key.
func NotContainsValue ¶ added in v0.1.4
func NotContainsValue[K, V comparable, M ~map[K]V](t TestingT, actual M, expected V) bool
NotContainsValue asserts that a map does not contain an expected value.
func NotDeepEqual ¶ added in v0.1.4
NotDeepEqual asserts that two values are not deeply equal.
func NotEqual ¶ added in v0.1.4
func NotEqual[T comparable](t TestingT, actual, expected T) bool
NotEqual asserts that two comparable values are not equal.
func NotErrorIs ¶ added in v0.1.4
NotErrorIs asserts that an error does not match another error using errors.Is.
func NotErrorMessageIs ¶ added in v0.1.4
NotErrorMessageIs asserts that an error's message does not match the expected string.
func NotMapEmpty ¶ added in v0.1.6
func NotMapEmpty[K comparable, V any, M ~map[K]V](t TestingT, actual M) bool
func NotRegexpMatch ¶ added in v0.1.4
NotRegexpMatch asserts that a string does not match a regular expression.
func NotSliceEmpty ¶ added in v0.1.6
func NotZero ¶ added in v0.1.5
NotZero asserts that a value does not equal its zero value. Works with any type by using reflection.
func RegexpMatch ¶ added in v0.1.4
RegexpMatch asserts that a string matches a regular expression.
func SliceEmpty ¶ added in v0.1.6
Types ¶
type Matcher ¶ added in v0.1.4
Matcher is an interface for custom matchers that can match against a value.
type MatcherFunc ¶ added in v0.1.4
MatcherFunc is a function type that implements Matcher.
func (MatcherFunc[Actual]) Match ¶ added in v0.1.4
func (f MatcherFunc[Actual]) Match(actual Actual) (bool, string)
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package mocktesting is a generated GoMock package.
|
Package mocktesting is a generated GoMock package. |