|
|
@ -3,6 +3,7 @@ package redis
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"crypto/tls"
|
|
|
|
"crypto/tls"
|
|
|
|
"errors"
|
|
|
|
"errors"
|
|
|
|
|
|
|
|
"github.com/tal-tech/go-zero/core/stringx"
|
|
|
|
"io"
|
|
|
|
"io"
|
|
|
|
"strconv"
|
|
|
|
"strconv"
|
|
|
|
"testing"
|
|
|
|
"testing"
|
|
|
@ -186,7 +187,7 @@ func TestRedis_Hscan(t *testing.T) {
|
|
|
|
key := "hash:test"
|
|
|
|
key := "hash:test"
|
|
|
|
fieldsAndValues := make(map[string]string)
|
|
|
|
fieldsAndValues := make(map[string]string)
|
|
|
|
for i := 0; i < 1550; i++ {
|
|
|
|
for i := 0; i < 1550; i++ {
|
|
|
|
fieldsAndValues["filed_"+strconv.Itoa(i)] = randomStr(i)
|
|
|
|
fieldsAndValues["filed_"+strconv.Itoa(i)] = stringx.Randn(i)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
err := client.Hmset(key, fieldsAndValues)
|
|
|
|
err := client.Hmset(key, fieldsAndValues)
|
|
|
|
assert.Nil(t, err)
|
|
|
|
assert.Nil(t, err)
|
|
|
@ -550,7 +551,7 @@ func TestRedis_Sscan(t *testing.T) {
|
|
|
|
key := "list"
|
|
|
|
key := "list"
|
|
|
|
var list []string
|
|
|
|
var list []string
|
|
|
|
for i := 0; i < 1550; i++ {
|
|
|
|
for i := 0; i < 1550; i++ {
|
|
|
|
list = append(list, randomStr(i))
|
|
|
|
list = append(list, stringx.Randn(i))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
lens, err := client.Sadd(key, list)
|
|
|
|
lens, err := client.Sadd(key, list)
|
|
|
|
assert.Nil(t, err)
|
|
|
|
assert.Nil(t, err)
|
|
|
|