1
0
mirror of https://github.com/charlienet/go-mixed.git synced 2025-07-18 08:32:40 +08:00

use redis function(Version 7 and above is required

)
This commit is contained in:
2023-11-03 15:46:45 +08:00
parent 2f2af226ee
commit 01f426c5b2
6 changed files with 57 additions and 42 deletions

View File

@ -1,16 +1,22 @@
package bloom
import (
"context"
"testing"
"time"
"github.com/charlienet/go-mixed/redis"
"github.com/charlienet/go-mixed/tests"
)
func TestRedisStore(t *testing.T) {
tests.RunOnRedis(t, func(client redis.Client) {
tests.RunOnDefaultRedis(t, func(client redis.Client) {
store := newRedisStore(client, "abcdef", 10000)
err := store.Set(1, 2, 3, 9, 1223)
ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
defer cancel()
err := store.Set(ctx, 1, 2, 3, 9, 1223)
if err != nil {
t.Fatal(err)
}