improve unit testing case for package gcache

This commit is contained in:
John Guo
2021-11-20 12:08:14 +08:00
parent cd9ea5697b
commit 8db890c510

View File

@ -119,7 +119,7 @@ func TestCache_UpdateExpire(t *testing.T) {
newExpire := 10 * time.Second
oldExpire2, err := gcache.UpdateExpire(ctx, key, newExpire)
t.AssertNil(err)
t.Assert(oldExpire2, oldExpire)
t.AssertIN(oldExpire2, g.Slice{oldExpire, `2.999s`})
e, _ := gcache.GetExpire(ctx, key)
t.AssertNE(e, oldExpire)