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

优化redis eval的key重命名

This commit is contained in:
2023-10-26 15:47:33 +08:00
parent 91a5a7d612
commit 5a17236fd7
5 changed files with 30 additions and 16 deletions

View File

@ -1,9 +1,24 @@
package redis
import "testing"
import (
"context"
"testing"
"github.com/stretchr/testify/assert"
)
func TestRename(t *testing.T) {
New(&ReidsOption{
New(&RedisOption{
Addrs: []string{"192.168.123.100:6379"},
})
}
func TestEvalName(t *testing.T) {
rdb := New(&RedisOption{
Addrs: []string{"192.168.123.100:6379"},
Prefix: "aabbcc",
})
_, err := rdb.Eval(context.Background(), "return 1", []string{"a1", "a2", "a3"}, "b1", "b2", "b3").Result()
assert.Nil(t, err, err)
}