diff --git a/tests/gocase/unit/scan/scan_test.go b/tests/gocase/unit/scan/scan_test.go index 439b38776e8..1e6488d78d1 100644 --- a/tests/gocase/unit/scan/scan_test.go +++ b/tests/gocase/unit/scan/scan_test.go @@ -48,7 +48,7 @@ func TestScanEmptyKey(t *testing.T) { keys, _, err := rdb.SScan(ctx, "sadd_key", 0, "*", 10000).Result() require.NoError(t, err) slices.Sort(keys) - slices.Compact(keys) + keys = slices.Compact(keys) require.Equal(t, []string{"", "fab", "fiz", "foobar"}, keys) } @@ -77,7 +77,7 @@ func ScanTest(t *testing.T, rdb *redis.Client, ctx context.Context) { require.NoError(t, rdb.FlushDB(ctx).Err()) util.Populate(t, rdb, "", 1000, 10) keys := scanAll(t, rdb) - slices.Compact(keys) + keys = slices.Compact(keys) require.Len(t, keys, 1000) }) @@ -85,7 +85,7 @@ func ScanTest(t *testing.T, rdb *redis.Client, ctx context.Context) { require.NoError(t, rdb.FlushDB(ctx).Err()) util.Populate(t, rdb, "", 1000, 10) keys := scanAll(t, rdb, "count", 5) - slices.Compact(keys) + keys = slices.Compact(keys) require.Len(t, keys, 1000) }) @@ -93,7 +93,7 @@ func ScanTest(t *testing.T, rdb *redis.Client, ctx context.Context) { require.NoError(t, rdb.FlushDB(ctx).Err()) util.Populate(t, rdb, "key:", 1000, 10) keys := scanAll(t, rdb, "match", "key:*") - slices.Compact(keys) + keys = slices.Compact(keys) require.Len(t, keys, 1000) }) @@ -127,7 +127,7 @@ func ScanTest(t *testing.T, rdb *redis.Client, ctx context.Context) { } originKeys = append(originKeys, key) } - slices.Compact(originKeys) + originKeys = slices.Compact(originKeys) require.Len(t, originKeys, 100) }) @@ -173,7 +173,7 @@ func ScanTest(t *testing.T, rdb *redis.Client, ctx context.Context) { keys, _, err := rdb.SScan(ctx, "mykey", 0, "foo*", 10000).Result() require.NoError(t, err) slices.Sort(keys) - slices.Compact(keys) + keys = slices.Compact(keys) require.Equal(t, []string{"foo", "foobar"}, keys) }) @@ -183,7 +183,7 @@ func ScanTest(t *testing.T, rdb *redis.Client, ctx context.Context) { keys, _, err := rdb.HScan(ctx, "mykey", 0, "foo*", 10000).Result() require.NoError(t, err) slices.Sort(keys) - slices.Compact(keys) + keys = slices.Compact(keys) require.Equal(t, []string{"1", "10", "foo", "foobar"}, keys) }) @@ -199,7 +199,7 @@ func ScanTest(t *testing.T, rdb *redis.Client, ctx context.Context) { keys, _, err := rdb.ZScan(ctx, "mykey", 0, "foo*", 10000).Result() require.NoError(t, err) slices.Sort(keys) - slices.Compact(keys) + keys = slices.Compact(keys) require.Equal(t, []string{"1", "10", "foo", "foobar"}, keys) }) @@ -219,7 +219,7 @@ func ScanTest(t *testing.T, rdb *redis.Client, ctx context.Context) { require.NoError(t, rdb.SAdd(ctx, "set", elements...).Err()) keys, _, err := rdb.SScan(ctx, "set", 0, "", 10000).Result() require.NoError(t, err) - slices.Compact(keys) + keys = slices.Compact(keys) require.Len(t, keys, 100) }) }