adjust TestCache_Expire_SetVar Test Code.

This commit is contained in:
糖水不加糖
2020-08-07 16:26:26 +08:00
parent 919eaf1e9a
commit 4871f86346

View File

@ -77,10 +77,7 @@ func TestCache_Expire_SetVar(t *testing.T) {
gtest.C(t, func(t *gtest.T) {
cache := gcache.New()
cache.Set(1, 11, 3*time.Second)
expireBefore, okBefore := cache.GetExpire(1)
if okBefore {
t.AssertGT(expireBefore, 0)
}
expireBefore, _ := cache.GetExpire(1)
t.Assert(cache.Get(1), 11)
cache.SetVar(1, 12)
t.Assert(cache.Get(1), 12)