-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinmemory_test.go
47 lines (36 loc) · 1.06 KB
/
inmemory_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright (c) 2012-2016 The Revel Framework Authors, All rights reserved.
// Revel Framework source code and usage is governed by a MIT style
// license that can be found in the LICENSE file.
package cache
import (
"testing"
"time"
)
var newInMemoryCache = func(_ *testing.T, defaultExpiration time.Duration) Cache {
return NewInMemoryCache(defaultExpiration)
}
// Test typical cache interactions
func TestInMemoryCache_TypicalGetSet(t *testing.T) {
typicalGetSet(t, newInMemoryCache)
}
func TestInMemoryCache_SetFields(t *testing.T) {
testSetFields(t, newInMemoryCache)
}
func TestInMemoryCache_Expiration(t *testing.T) {
expiration(t, newInMemoryCache)
}
func TestInMemoryCache_EmptyCache(t *testing.T) {
emptyCache(t, newInMemoryCache)
}
func TestInMemoryCache_Replace(t *testing.T) {
testReplace(t, newInMemoryCache)
}
func TestInMemoryCache_Add(t *testing.T) {
testAdd(t, newInMemoryCache)
}
func TestInMemoryCache_GetMulti(t *testing.T) {
testGetMulti(t, newInMemoryCache)
}
func TestInMemoryCache_Keys(t *testing.T) {
testKeys(t, newInMemoryCache)
}