Documentation
¶
Index ¶
- func Equal[T any](t TestingT, expected, actual T, opts ...Option[T])
- func NewSpanID(t *testing.T, v string) trace.SpanID
- func NewTraceID(t *testing.T, v string) trace.TraceID
- func NewTraceState(t *testing.T, value string) trace.TraceState
- type MockOption
- type MockOption_Execute_Call
- type MockOption_Expecter
- type MockTestingT
- type MockTestingT_Errorf_Call
- type MockTestingT_Expecter
- type MockTestingT_FailNow_Call
- type MockTestingT_Helper_Call
- type Option
- func EquateComparable[T any](typs ...any) Option[T]
- func IgnoreMapEntries[K comparable, V any](predicate func(K, V) bool) Option[map[K]V]
- func IgnoreSliceElements[T any](predicate func(T) bool) Option[[]T]
- func IgnoreSliceMapEntries[K comparable, V any](predicate func(K, V) bool) Option[[]map[K]V]
- func IgnoreSliceOrder[T any]() Option[[]T]
- func IgnoreUnexported[T any](typs ...any) Option[T]
- func SortSlices[S []T, T any](cmpFunc func(T, T) int) Option[S]
- type TestingT
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Equal ¶
Equal compares the expected and actual values of type T.
It fails the test immediately if the values are not equal, and reports the difference using cmp.Diff.
Options can be provided via opts to customize the comparison.
func NewTraceState ¶
func NewTraceState(t *testing.T, value string) trace.TraceState
Types ¶
type MockOption ¶
MockOption is an autogenerated mock type for the Option type
func NewMockOption ¶
func NewMockOption[T any](t interface { mock.TestingT Cleanup(func()) }) *MockOption[T]
NewMockOption creates a new instance of MockOption. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockOption[T]) EXPECT ¶
func (_m *MockOption[T]) EXPECT() *MockOption_Expecter[T]
func (*MockOption[T]) Execute ¶ added in v1.0.10
func (_m *MockOption[T]) Execute() cmp.Option
Execute provides a mock function with no fields
type MockOption_Execute_Call ¶ added in v1.0.10
MockOption_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute'
func (*MockOption_Execute_Call[T]) Return ¶ added in v1.0.10
func (_c *MockOption_Execute_Call[T]) Return(_a0 cmp.Option) *MockOption_Execute_Call[T]
func (*MockOption_Execute_Call[T]) Run ¶ added in v1.0.10
func (_c *MockOption_Execute_Call[T]) Run(run func()) *MockOption_Execute_Call[T]
func (*MockOption_Execute_Call[T]) RunAndReturn ¶ added in v1.0.10
func (_c *MockOption_Execute_Call[T]) RunAndReturn(run func() cmp.Option) *MockOption_Execute_Call[T]
type MockOption_Expecter ¶
type MockOption_Expecter[T any] struct { // contains filtered or unexported fields }
func (*MockOption_Expecter[T]) Execute ¶ added in v1.0.10
func (_e *MockOption_Expecter[T]) Execute() *MockOption_Execute_Call[T]
Execute is a helper method to define mock.On call
type MockTestingT ¶
MockTestingT is an autogenerated mock type for the TestingT type
func NewMockTestingT ¶
func NewMockTestingT(t interface {
mock.TestingT
Cleanup(func())
}) *MockTestingT
NewMockTestingT creates a new instance of MockTestingT. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockTestingT) EXPECT ¶
func (_m *MockTestingT) EXPECT() *MockTestingT_Expecter
func (*MockTestingT) Errorf ¶
func (_mock *MockTestingT) Errorf(format string, args ...any)
Errorf provides a mock function for the type MockTestingT
func (*MockTestingT) FailNow ¶
func (_mock *MockTestingT) FailNow()
FailNow provides a mock function for the type MockTestingT
func (*MockTestingT) Helper ¶
func (_mock *MockTestingT) Helper()
Helper provides a mock function for the type MockTestingT
type MockTestingT_Errorf_Call ¶
MockTestingT_Errorf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Errorf'
func (*MockTestingT_Errorf_Call) Return ¶
func (_c *MockTestingT_Errorf_Call) Return() *MockTestingT_Errorf_Call
func (*MockTestingT_Errorf_Call) Run ¶
func (_c *MockTestingT_Errorf_Call) Run(run func(format string, args ...any)) *MockTestingT_Errorf_Call
func (*MockTestingT_Errorf_Call) RunAndReturn ¶
func (_c *MockTestingT_Errorf_Call) RunAndReturn(run func(format string, args ...any)) *MockTestingT_Errorf_Call
type MockTestingT_Expecter ¶
type MockTestingT_Expecter struct {
// contains filtered or unexported fields
}
func (*MockTestingT_Expecter) Errorf ¶
func (_e *MockTestingT_Expecter) Errorf(format interface{}, args ...interface{}) *MockTestingT_Errorf_Call
Errorf is a helper method to define mock.On call
- format string
- args ...any
func (*MockTestingT_Expecter) FailNow ¶
func (_e *MockTestingT_Expecter) FailNow() *MockTestingT_FailNow_Call
FailNow is a helper method to define mock.On call
func (*MockTestingT_Expecter) Helper ¶
func (_e *MockTestingT_Expecter) Helper() *MockTestingT_Helper_Call
Helper is a helper method to define mock.On call
type MockTestingT_FailNow_Call ¶
MockTestingT_FailNow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FailNow'
func (*MockTestingT_FailNow_Call) Return ¶
func (_c *MockTestingT_FailNow_Call) Return() *MockTestingT_FailNow_Call
func (*MockTestingT_FailNow_Call) Run ¶
func (_c *MockTestingT_FailNow_Call) Run(run func()) *MockTestingT_FailNow_Call
func (*MockTestingT_FailNow_Call) RunAndReturn ¶
func (_c *MockTestingT_FailNow_Call) RunAndReturn(run func()) *MockTestingT_FailNow_Call
type MockTestingT_Helper_Call ¶
MockTestingT_Helper_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Helper'
func (*MockTestingT_Helper_Call) Return ¶
func (_c *MockTestingT_Helper_Call) Return() *MockTestingT_Helper_Call
func (*MockTestingT_Helper_Call) Run ¶
func (_c *MockTestingT_Helper_Call) Run(run func()) *MockTestingT_Helper_Call
func (*MockTestingT_Helper_Call) RunAndReturn ¶
func (_c *MockTestingT_Helper_Call) RunAndReturn(run func()) *MockTestingT_Helper_Call
type Option ¶
Option represents a comparer option that applies to a specific type T
func EquateComparable ¶
func IgnoreMapEntries ¶
func IgnoreMapEntries[K comparable, V any](predicate func(K, V) bool) Option[map[K]V]
IgnoreMapEntries returns an Option that causes the comparison to skip map entries that satisfy the given predicate function
func IgnoreSliceElements ¶
func IgnoreSliceMapEntries ¶
func IgnoreSliceMapEntries[K comparable, V any](predicate func(K, V) bool) Option[[]map[K]V]
IgnoreSliceMapEntries returns an Option that causes the comparison to skip map entries that satisfy the given predicate function