rewriting cache to sync.Map and make all cache tests work
This commit is contained in:
parent
22622817e6
commit
fdb9829e38
|
@ -1762,9 +1762,13 @@ func TestGetWithExpiration(t *testing.T) {
|
||||||
} else if e2 := x.(int); e2+2 != 3 {
|
} else if e2 := x.(int); e2+2 != 3 {
|
||||||
t.Error("e (which should be 1) plus 2 does not equal 3; value:", e2)
|
t.Error("e (which should be 1) plus 2 does not equal 3; value:", e2)
|
||||||
}
|
}
|
||||||
//if expiration.UnixNano() != tc.items["e"].Expiration {
|
tmp, ok := tc.items.Load("e")
|
||||||
// t.Error("expiration for e is not the correct time")
|
if ok {
|
||||||
//}
|
e := tmp.(Item)
|
||||||
|
if expiration.UnixNano() != e.Expiration {
|
||||||
|
t.Error("expiration for e is not the correct time")
|
||||||
|
}
|
||||||
|
}
|
||||||
if expiration.UnixNano() < time.Now().UnixNano() {
|
if expiration.UnixNano() < time.Now().UnixNano() {
|
||||||
t.Error("expiration for e is in the past")
|
t.Error("expiration for e is in the past")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue