-
Notifications
You must be signed in to change notification settings - Fork 4
/
tiny_info_test.go
35 lines (30 loc) · 934 Bytes
/
tiny_info_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package Figo
import (
"github.com/quexer/red"
"github.com/sirupsen/logrus"
"testing"
)
func TestRedTinyInfo_Put(t *testing.T) {
pool := red.CreatePool(10, "127.0.0.1:6379", "")
redDo := red.BuildDoFunc(pool)
tf := NewTinyInfo(redDo, "test")
v, err := tf.Put("hello")
logrus.WithField("seq", v).WithField("err", err).Println()
v, err = tf.Put("world")
logrus.WithField("seq", v).WithField("err", err).Println()
v, err = tf.Put("how")
logrus.WithField("seq", v).WithField("err", err).Println()
v, err = tf.Put("r")
logrus.WithField("seq", v).WithField("err", err).Println()
v, err = tf.Put("u")
logrus.WithField("seq", v).WithField("err", err).Println()
}
func TestRedTinyInfo_Get(t *testing.T) {
pool := red.CreatePool(10, "127.0.0.1:6379", "")
redDo := red.BuildDoFunc(pool)
tf := NewTinyInfo(redDo, "test")
for i := 1; i < 5; i++ {
content, _ := tf.Get(i)
logrus.WithField("val", content).Println()
}
}