Skip to content

Commit

Permalink
Merge conflict resolution
Browse files Browse the repository at this point in the history
Re-run mock generation

Fix tests
  • Loading branch information
LandonTClipp committed May 24, 2022
1 parent ed55a47 commit 4c0f6c8
Show file tree
Hide file tree
Showing 8 changed files with 284 additions and 7 deletions.
42 changes: 42 additions & 0 deletions mocks/pkg/fixtures/EmbeddedGet.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions mocks/pkg/fixtures/GetGeneric.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions mocks/pkg/fixtures/GetInt.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

96 changes: 96 additions & 0 deletions mocks/pkg/fixtures/RequesterGenerics.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions mocks/pkg/fixtures/constraints/Integer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions mocks/pkg/fixtures/constraints/Signed.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions pkg/generator.go
Expand Up @@ -814,9 +814,8 @@ type {{ .ConstructorTestingInterfaceName }} interface {
}
// {{ .ConstructorName }} creates a new instance of {{ .MockName }}. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func {{ .ConstructorName }}{{ .TypeConstraint }}(t {{ .ConstructorTestingInterfaceName }}) *{{ .MockName }}{{ .TypeParams }} {
func {{ .ConstructorName }}{{ .TypeConstraint }}(t {{ .ConstructorTestingInterfaceName }}) *{{ .MockName }}{{ .InstantiatedTypeString }} {
mock := &{{ .MockName }}{{ .InstantiatedTypeString }}{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
Expand All @@ -833,7 +832,6 @@ func {{ .ConstructorName }}{{ .TypeConstraint }}(t {{ .ConstructorTestingInterfa
InstantiatedTypeString string
MockName string
TypeConstraint string
TypeParams string
}{
ConstructorName: constructorName,
ConstructorTestingInterfaceName: constructorName + "T",
Expand Down
18 changes: 14 additions & 4 deletions pkg/generator_test.go
Expand Up @@ -2091,11 +2091,16 @@ func (_m *RequesterGenerics[TAny, TComparable, TSigned, TIntf, TExternalIntf, TG
return r0
}
// NewRequesterGenerics creates a new instance of RequesterGenerics. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations.
type NewRequesterGenericsT interface {
mock.TestingT
Cleanup(func())
}
// NewRequesterGenerics creates a new instance of RequesterGenerics. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewRequesterGenerics[TAny interface{}, TComparable comparable, TSigned constraints.Signed, TIntf test.GetInt, TExternalIntf io.Writer, TGenIntf test.GetGeneric[TSigned], TInlineType interface{ ~int | ~uint }, TInlineTypeGeneric interface {
~int | test.GenericType[int, test.GetInt]
comparable
}](t testing.TB) *RequesterGenerics[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric] {
}](t NewRequesterGenericsT) *RequesterGenerics[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric] {
mock := &RequesterGenerics[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric]{}
mock.Mock.Test(t)
Expand Down Expand Up @@ -2173,11 +2178,16 @@ func (_m *MockRequesterGenerics[TAny, TComparable, TSigned, TIntf, TExternalIntf
return r0
}
// NewMockRequesterGenerics creates a new instance of MockRequesterGenerics. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations.
type NewMockRequesterGenericsT interface {
mock.TestingT
Cleanup(func())
}
// NewMockRequesterGenerics creates a new instance of MockRequesterGenerics. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewMockRequesterGenerics[TAny interface{}, TComparable comparable, TSigned constraints.Signed, TIntf GetInt, TExternalIntf io.Writer, TGenIntf GetGeneric[TSigned], TInlineType interface{ ~int | ~uint }, TInlineTypeGeneric interface {
~int | GenericType[int, GetInt]
comparable
}](t testing.TB) *MockRequesterGenerics[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric] {
}](t NewMockRequesterGenericsT) *MockRequesterGenerics[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric] {
mock := &MockRequesterGenerics[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric]{}
mock.Mock.Test(t)
Expand Down

0 comments on commit 4c0f6c8

Please sign in to comment.