-
Notifications
You must be signed in to change notification settings - Fork 414
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ba9924e
commit 252ef3c
Showing
7 changed files
with
127 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 0 additions & 83 deletions
83
mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterIfaceWithInterfaceTypedParam.go
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package iface_typed_param | ||
|
||
import "io" | ||
|
||
type GetterIfaceTypedParam[T io.Reader] interface { | ||
Get() T | ||
} |
83 changes: 83 additions & 0 deletions
83
pkg/fixtures/iface_typed_param/getter_iface_typed_param_mock_test.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package iface_typed_param_test | ||
|
||
import ( | ||
"bufio" | ||
"net/http" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestIfaceWithIfaceTypedParamReturnValues(t *testing.T) { | ||
t.Parallel() | ||
|
||
tests := []struct { | ||
name string | ||
returnVal *bufio.Reader | ||
}{ | ||
{"nil return val", nil}, | ||
{"returning val", bufio.NewReader(http.NoBody)}, | ||
} | ||
for _, test := range tests { | ||
t.Run(test.name, func(st *testing.T) { | ||
m := NewGetterIfaceTypedParam[*bufio.Reader](st) | ||
m.EXPECT().Get().Return(test.returnVal) | ||
|
||
assert.Equal(st, test.returnVal, m.Get()) | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters