Skip to content

Commit

Permalink
test(all): Update import paths due to renaming of drivertest
Browse files Browse the repository at this point in the history
  • Loading branch information
bartventer committed Jun 14, 2024
1 parent 6d67e62 commit b2dd425
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions memcache/memcache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"time"

cache "github.com/bartventer/gocache"
"github.com/bartventer/gocache/internal/cachetest"
"github.com/bartventer/gocache/drivertest"
"github.com/bradfitz/gomemcache/memcache"
"github.com/docker/docker/api/types/container"
"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -134,20 +134,20 @@ func (h *harness) Close() {
// Cleanup is handled in setup function
}

func (h *harness) Options() cachetest.Options {
return cachetest.Options{
func (h *harness) Options() drivertest.Options {
return drivertest.Options{
PatternMatchingDisabled: true, // Memcached does not support pattern matching
CloseIsNoop: true, // Cache can still be used after closing
}
}

func newHarness(ctx context.Context, t *testing.T) (cachetest.Harness, error) {
func newHarness(ctx context.Context, t *testing.T) (drivertest.Harness, error) {
cache := setupCache(t)
return &harness{
cache: cache,
}, nil
}

func TestConformance(t *testing.T) {
cachetest.RunConformanceTests(t, newHarness)
drivertest.RunConformanceTests(t, newHarness)
}
10 changes: 5 additions & 5 deletions redis/redis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"time"

cache "github.com/bartventer/gocache"
"github.com/bartventer/gocache/internal/cachetest"
"github.com/bartventer/gocache/drivertest"
"github.com/docker/docker/api/types/container"
"github.com/redis/go-redis/v9"
"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -112,20 +112,20 @@ func (h *harness) Close() {
// Cleanup is handled in setup function
}

func (h *harness) Options() cachetest.Options {
return cachetest.Options{
func (h *harness) Options() drivertest.Options {
return drivertest.Options{
PatternMatchingDisabled: false,
CloseIsNoop: false,
}
}

func newHarness(ctx context.Context, t *testing.T) (cachetest.Harness, error) {
func newHarness(ctx context.Context, t *testing.T) (drivertest.Harness, error) {
cache := setupCache(t)
return &harness{
cache: cache,
}, nil
}

func TestConformance(t *testing.T) {
cachetest.RunConformanceTests(t, newHarness)
drivertest.RunConformanceTests(t, newHarness)
}
10 changes: 5 additions & 5 deletions rediscluster/rediscluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"time"

cache "github.com/bartventer/gocache"
"github.com/bartventer/gocache/internal/cachetest"
"github.com/bartventer/gocache/drivertest"
"github.com/docker/docker/api/types/container"
"github.com/docker/go-connections/nat"
"github.com/redis/go-redis/v9"
Expand Down Expand Up @@ -128,20 +128,20 @@ func (h *harness) Close() {
// Cleanup is handled in setup function
}

func (h *harness) Options() cachetest.Options {
return cachetest.Options{
func (h *harness) Options() drivertest.Options {
return drivertest.Options{
PatternMatchingDisabled: false,
CloseIsNoop: false,
}
}

func newHarness(ctx context.Context, t *testing.T) (cachetest.Harness, error) {
func newHarness(ctx context.Context, t *testing.T) (drivertest.Harness, error) {
cache := setupCache(t)
return &harness{
cache: cache,
}, nil
}

func TestConformance(t *testing.T) {
cachetest.RunConformanceTests(t, newHarness)
drivertest.RunConformanceTests(t, newHarness)
}

0 comments on commit b2dd425

Please sign in to comment.