From fcea0f7ec8b317ba8d7c5b6a2ae1c9e740757f8d Mon Sep 17 00:00:00 2001 From: Khanh Hoa Date: Thu, 12 Sep 2024 14:31:12 +0700 Subject: [PATCH 1/3] refactor: add miss mocks Flush --- mocks/mocks.go | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/mocks/mocks.go b/mocks/mocks.go index 4f1eb10..c6c7320 100644 --- a/mocks/mocks.go +++ b/mocks/mocks.go @@ -5,6 +5,7 @@ // // mockgen -source=batcher.go -destination mocks/mocks.go -package mocks // + // Package mocks is a generated GoMock package. package mocks @@ -67,6 +68,20 @@ func (mr *MockBatchableTaskMockRecorder[R]) Done() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Done", reflect.TypeOf((*MockBatchableTask[R])(nil).Done)) } +// IsDone mocks base method. +func (m *MockBatchableTask[R]) IsDone() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IsDone") + ret0, _ := ret[0].(bool) + return ret0 +} + +// IsDone indicates an expected call of IsDone. +func (mr *MockBatchableTaskMockRecorder[R]) IsDone() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsDone", reflect.TypeOf((*MockBatchableTask[R])(nil).IsDone)) +} + // Resolve mocks base method. func (m *MockBatchableTask[R]) Resolve(ret R, err error) { m.ctrl.T.Helper() @@ -79,6 +94,21 @@ func (mr *MockBatchableTaskMockRecorder[R]) Resolve(ret, err any) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Resolve", reflect.TypeOf((*MockBatchableTask[R])(nil).Resolve), ret, err) } +// Result mocks base method. +func (m *MockBatchableTask[R]) Result() (R, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Result") + ret0, _ := ret[0].(R) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Result indicates an expected call of Result. +func (mr *MockBatchableTaskMockRecorder[R]) Result() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Result", reflect.TypeOf((*MockBatchableTask[R])(nil).Result)) +} + // MockBatcher is a mock of Batcher interface. type MockBatcher[T kutils.BatchableTask[R], R any] struct { ctrl *gomock.Controller @@ -125,3 +155,15 @@ func (mr *MockBatcherMockRecorder[T, R]) Close() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockBatcher[T, R])(nil).Close)) } + +// Flush mocks base method. +func (m *MockBatcher[T, R]) Flush() { + m.ctrl.T.Helper() + m.ctrl.Call(m, "Flush") +} + +// Flush indicates an expected call of Flush. +func (mr *MockBatcherMockRecorder[T, R]) Flush() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Flush", reflect.TypeOf((*MockBatcher[T, R])(nil).Flush)) +} From b54ff8e58802ba490f6772a46f606278e59775b4 Mon Sep 17 00:00:00 2001 From: Khanh Hoa Date: Thu, 12 Sep 2024 15:10:36 +0700 Subject: [PATCH 2/3] test sign --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 96a1835..fcfa478 100644 --- a/README.md +++ b/README.md @@ -10,3 +10,4 @@ Reusable Kyber utilities - num.go: Conversions, Min, Max, Abs - slice.go: Checks for existence, maps with fn, gets unique elements, filters - string.go: String utils +- \ No newline at end of file From 4da3aaafb4eefa1e10b8bf9f09b2358e22e48517 Mon Sep 17 00:00:00 2001 From: Khanh Hoa Date: Thu, 12 Sep 2024 15:20:28 +0700 Subject: [PATCH 3/3] test commit --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index fcfa478..8c9f9a6 100644 --- a/README.md +++ b/README.md @@ -9,5 +9,4 @@ Reusable Kyber utilities - map.go: Collects values from a slice - num.go: Conversions, Min, Max, Abs - slice.go: Checks for existence, maps with fn, gets unique elements, filters -- string.go: String utils -- \ No newline at end of file +- string.go: String utils \ No newline at end of file