1
0
mirror of https://github.com/astaxie/beego.git synced 2025-06-11 09:50:39 +00:00
This commit is contained in:
JessonChan
2016-03-25 10:56:15 +08:00
parent 94bde3a777
commit 2db8c753fd
8 changed files with 42 additions and 41 deletions

View File

@ -19,7 +19,7 @@ func TestSsdbcacheCache(t *testing.T) {
}
timeoutDuration := 10 * time.Second
//timeoutDuration := -10*time.Second if timeoutDuration is negtive,it means permanent
if err = ssdb.Put("ssdb", "ssdb", timeoutDuration); err != nil {
if err = ssdb.Put("ssdb", "ssdb", timeoutDuration*time.Second); err != nil {
t.Error("set Error", err)
}
if !ssdb.IsExist("ssdb") {
@ -27,7 +27,7 @@ func TestSsdbcacheCache(t *testing.T) {
}
// Get test done
if err = ssdb.Put("ssdb", "ssdb", timeoutDuration); err != nil {
if err = ssdb.Put("ssdb", "ssdb", timeoutDuration*time.Second); err != nil {
t.Error("set Error", err)
}
@ -36,7 +36,7 @@ func TestSsdbcacheCache(t *testing.T) {
}
//inc/dec test done
if err = ssdb.Put("ssdb", "2", timeoutDuration); err != nil {
if err = ssdb.Put("ssdb", "2", timeoutDuration*time.Second); err != nil {
t.Error("set Error", err)
}
if err = ssdb.Incr("ssdb"); err != nil {
@ -52,7 +52,7 @@ func TestSsdbcacheCache(t *testing.T) {
}
// test del
if err = ssdb.Put("ssdb", "3", timeoutDuration); err != nil {
if err = ssdb.Put("ssdb", "3", timeoutDuration*time.Second); err != nil {
t.Error("set Error", err)
}
if v, err := strconv.Atoi(ssdb.Get("ssdb").(string)); err != nil || v != 3 {