Skip to content

Commit

Permalink
object/test: Accept testing.TB instead of testing.T in generators
Browse files Browse the repository at this point in the history
This allows to use generators in benchmark tests and pass `testing.B`.

Signed-off-by: Leonard Lyubich <[email protected]>
  • Loading branch information
cthulhu-rider committed Dec 14, 2023
1 parent f984d48 commit a4a8dab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions object/test/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func SplitID() object.SplitID {
return *x
}

func generate(t *testing.T, withParent bool) object.Object {
func generate(t testing.TB, withParent bool) object.Object {
x := object.New()
ver := version.Current()

Expand Down Expand Up @@ -74,12 +74,12 @@ func generate(t *testing.T, withParent bool) object.Object {

// Raw returns random object.Object.
// Deprecated: (v1.0.0) use Object instead.
func Raw(t *testing.T) object.Object {
func Raw(t testing.TB) object.Object {
return Object(t)
}

// Object returns random object.Object.
func Object(t *testing.T) object.Object {
func Object(t testing.TB) object.Object {
return generate(t, true)
}

Expand Down

0 comments on commit a4a8dab

Please sign in to comment.