1 // Copyright (c) 2012-2016 The Revel Framework Authors, All rights reserved.
2 // Revel Framework source code and usage is governed by a MIT style
3 // license that can be found in the LICENSE file.
12 var newInMemoryCache = func(_ *testing.T, defaultExpiration time.Duration) Cache {
13 return NewInMemoryCache(defaultExpiration)
16 // Test typical cache interactions
17 func TestInMemoryCache_TypicalGetSet(t *testing.T) {
18 typicalGetSet(t, newInMemoryCache)
21 // Test the increment-decrement cases
22 func TestInMemoryCache_IncrDecr(t *testing.T) {
23 incrDecr(t, newInMemoryCache)
26 func TestInMemoryCache_Expiration(t *testing.T) {
27 expiration(t, newInMemoryCache)
30 func TestInMemoryCache_EmptyCache(t *testing.T) {
31 emptyCache(t, newInMemoryCache)
34 func TestInMemoryCache_Replace(t *testing.T) {
35 testReplace(t, newInMemoryCache)
38 func TestInMemoryCache_Add(t *testing.T) {
39 testAdd(t, newInMemoryCache)
42 func TestInMemoryCache_GetMulti(t *testing.T) {
43 testGetMulti(t, newInMemoryCache)