diff --git a/.mockery.yaml b/.mockery.yaml new file mode 100644 index 00000000..77b3f80f --- /dev/null +++ b/.mockery.yaml @@ -0,0 +1,10 @@ +quiet: False +disable-version-string: True +with-expecter: True +mockname: "{{.InterfaceName}}" +filename: "{{.MockName}}.go" +outpkg: pkg/mocks +packages: + math/rand: + interfaces: + Source64: diff --git a/go.mod b/go.mod index b5f0bf7c..3f39fd97 100644 --- a/go.mod +++ b/go.mod @@ -47,6 +47,7 @@ require ( github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.32.1 // indirect github.com/prometheus/procfs v0.7.3 // indirect + github.com/stretchr/objx v0.5.2 // indirect github.com/x448/float16 v0.8.4 // indirect golang.org/x/crypto v0.28.0 // indirect golang.org/x/net v0.30.0 // indirect diff --git a/go.sum b/go.sum index 49dae534..fc95afc8 100644 --- a/go.sum +++ b/go.sum @@ -261,6 +261,8 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= diff --git a/pkg/mocks/math/rand/Source64.go b/pkg/mocks/math/rand/Source64.go new file mode 100644 index 00000000..d1019ac0 --- /dev/null +++ b/pkg/mocks/math/rand/Source64.go @@ -0,0 +1,155 @@ +// Code generated by mockery. DO NOT EDIT. + +package mocks + +import mock "github.com/stretchr/testify/mock" + +// Source64 is an autogenerated mock type for the Source64 type +type Source64 struct { + mock.Mock +} + +type Source64_Expecter struct { + mock *mock.Mock +} + +func (_m *Source64) EXPECT() *Source64_Expecter { + return &Source64_Expecter{mock: &_m.Mock} +} + +// Int63 provides a mock function with no fields +func (_m *Source64) Int63() int64 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Int63") + } + + var r0 int64 + if rf, ok := ret.Get(0).(func() int64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(int64) + } + + return r0 +} + +// Source64_Int63_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Int63' +type Source64_Int63_Call struct { + *mock.Call +} + +// Int63 is a helper method to define mock.On call +func (_e *Source64_Expecter) Int63() *Source64_Int63_Call { + return &Source64_Int63_Call{Call: _e.mock.On("Int63")} +} + +func (_c *Source64_Int63_Call) Run(run func()) *Source64_Int63_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Source64_Int63_Call) Return(_a0 int64) *Source64_Int63_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Source64_Int63_Call) RunAndReturn(run func() int64) *Source64_Int63_Call { + _c.Call.Return(run) + return _c +} + +// Seed provides a mock function with given fields: seed +func (_m *Source64) Seed(seed int64) { + _m.Called(seed) +} + +// Source64_Seed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Seed' +type Source64_Seed_Call struct { + *mock.Call +} + +// Seed is a helper method to define mock.On call +// - seed int64 +func (_e *Source64_Expecter) Seed(seed interface{}) *Source64_Seed_Call { + return &Source64_Seed_Call{Call: _e.mock.On("Seed", seed)} +} + +func (_c *Source64_Seed_Call) Run(run func(seed int64)) *Source64_Seed_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int64)) + }) + return _c +} + +func (_c *Source64_Seed_Call) Return() *Source64_Seed_Call { + _c.Call.Return() + return _c +} + +func (_c *Source64_Seed_Call) RunAndReturn(run func(int64)) *Source64_Seed_Call { + _c.Run(run) + return _c +} + +// Uint64 provides a mock function with no fields +func (_m *Source64) Uint64() uint64 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Uint64") + } + + var r0 uint64 + if rf, ok := ret.Get(0).(func() uint64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint64) + } + + return r0 +} + +// Source64_Uint64_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Uint64' +type Source64_Uint64_Call struct { + *mock.Call +} + +// Uint64 is a helper method to define mock.On call +func (_e *Source64_Expecter) Uint64() *Source64_Uint64_Call { + return &Source64_Uint64_Call{Call: _e.mock.On("Uint64")} +} + +func (_c *Source64_Uint64_Call) Run(run func()) *Source64_Uint64_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Source64_Uint64_Call) Return(_a0 uint64) *Source64_Uint64_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Source64_Uint64_Call) RunAndReturn(run func() uint64) *Source64_Uint64_Call { + _c.Call.Return(run) + return _c +} + +// NewSource64 creates a new instance of Source64. 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 NewSource64(t interface { + mock.TestingT + Cleanup(func()) +}) *Source64 { + mock := &Source64{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +}