From 2acb80b53afcbdbf5824cdc830c30815554be02e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Fri, 29 Aug 2025 12:05:06 +0200 Subject: [PATCH] chore: return a pointer to the generic suite --- mysql/mysql_test.go | 2 +- testhelpers/tck/suite.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mysql/mysql_test.go b/mysql/mysql_test.go index ea85068d..7507c583 100644 --- a/mysql/mysql_test.go +++ b/mysql/mysql_test.go @@ -145,7 +145,7 @@ func TestMySQLStorageTCK(t *testing.T) { s, err := tck.New[*Storage, *sql.DB](context.Background(), t, &MySQLStorageTCK{}, tck.PerTest()) require.NoError(t, err) - suite.Run(t, &s) + suite.Run(t, s) } func Benchmark_MYSQL_Set(b *testing.B) { diff --git a/testhelpers/tck/suite.go b/testhelpers/tck/suite.go index 0b730d9c..97a48502 100644 --- a/testhelpers/tck/suite.go +++ b/testhelpers/tck/suite.go @@ -76,9 +76,9 @@ type TCKSuite[T storage.Storage, D any, C testcontainers.Container] interface { } // New creates a new [StorageTestSuite] with the given [TCKSuite]. -func New[T storage.Storage, D any, C testcontainers.Container](ctx context.Context, t *testing.T, tckSuite TCKSuite[T, D, C], opts ...suiteOption) (StorageTestSuite[T, D, C], error) { +func New[T storage.Storage, D any, C testcontainers.Container](ctx context.Context, t *testing.T, tckSuite TCKSuite[T, D, C], opts ...suiteOption) (*StorageTestSuite[T, D, C], error) { if tckSuite == nil { - return StorageTestSuite[T, D, C]{}, fmt.Errorf("test suite is nil") + return nil, fmt.Errorf("test suite is nil") } s := StorageTestSuite[T, D, C]{ @@ -90,13 +90,13 @@ func New[T storage.Storage, D any, C testcontainers.Container](ctx context.Conte for _, opt := range opts { if err := opt.apply(&s); err != nil { - return StorageTestSuite[T, D, C]{}, fmt.Errorf("apply option: %w", err) + return nil, fmt.Errorf("apply option: %w", err) } } s.SetT(t) - return s, nil + return &s, nil } // StorageTestSuite is the test suite for the storage.