853 | 853 |
assert.NotNil(t, data, "Expected data to be not nil")
|
854 | 854 |
assert.Equal(t, nil, exists, "Expected data to exist")
|
855 | 855 |
assert.Equal(t, "world", (data.(string)), "Expected data content to be 'world'")
|
|
856 |
assert.Equal(t, ttl, orgttl, "Expected item TTL to be original TTL")
|
|
857 |
|
|
858 |
cache.SkipTTLExtensionOnHit(true)
|
|
859 |
cache.SetWithTTL("hello", "world", orgttl)
|
|
860 |
time.Sleep(10 * time.Millisecond)
|
|
861 |
data, ttl, exists = cache.GetWithTTL("hello")
|
|
862 |
assert.NotNil(t, data, "Expected data to be not nil")
|
|
863 |
assert.Equal(t, nil, exists, "Expected data to exist")
|
|
864 |
assert.Equal(t, "world", (data.(string)), "Expected data content to be 'world'")
|
856 | 865 |
assert.Less(t, ttl, orgttl, "Expected item TTL to be less than the original TTL")
|
857 | 866 |
assert.NotEqual(t, int(ttl), 0, "Expected item TTL to be not 0")
|
858 | 867 |
}
|