1
0
mirror of https://github.com/charlienet/go-mixed.git synced 2025-07-18 00:22:41 +08:00
Files
go-mixed/redis/rename_hook_test.go
2023-11-01 16:32:58 +08:00

28 lines
629 B
Go

package redis
import (
"context"
"testing"
"github.com/stretchr/testify/assert"
)
func TestRename(t *testing.T) {
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)
v, err := rdb.FunctionLoadReplace(context.Background(), "#!lua name=mylib\nredis.register_function('myfunc1', function() return 'hello world' end)").Result()
t.Log(v, err)
}