-
Notifications
You must be signed in to change notification settings - Fork 2
/
memory_test.go
70 lines (55 loc) · 1.41 KB
/
memory_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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package cachita
import (
"testing"
"time"
)
func TestNewMemoryCache(t *testing.T) {
t.Parallel()
newCache(Memory(), t)
}
func TestMemoryCacheExpires(t *testing.T) {
t.Parallel()
cacheExpires(NewMemoryCache(2*time.Minute, 5*time.Millisecond), t, 50*time.Millisecond, 150*time.Millisecond)
}
func TestMemoryCacheWithInt(t *testing.T) {
t.Parallel()
cacheWithInt(Memory(), t)
}
func BenchmarkMemoryCacheWithInt(b *testing.B) {
benchmarkCacheWithInt(Memory(), b)
}
func TestMemoryCacheWithString(t *testing.T) {
t.Parallel()
cacheWithString(Memory(), t)
}
func BenchmarkMemoryCacheWithString(b *testing.B) {
benchmarkCacheWithString(Memory(), b)
}
func TestMemoryCacheWithMapInterface(t *testing.T) {
t.Parallel()
cacheWithMapInterface(Memory(), t)
}
func BenchmarkMemoryCacheWithMapInterface(b *testing.B) {
benchmarkCacheWithMapInterface(Memory(), b)
}
func TestMemoryCacheWithStruct(t *testing.T) {
t.Parallel()
cacheWithStruct(Memory(), t)
}
func BenchmarkMemoryCacheWithStruct(b *testing.B) {
benchmarkCacheWithStruct(Memory(), b)
}
func TestMemory_Incr(t *testing.T) {
t.Parallel()
cacheIncr(Memory(), t)
}
func BenchmarkMemory_Incr(b *testing.B) {
benchmarkCacheIncr(Memory(), b)
}
func TestMemory_Tag(t *testing.T) {
t.Parallel()
cacheTag(Memory(), t)
}
func BenchmarkMemory_Tag(b *testing.B) {
benchmarkCacheTag(Memory(), b)
}