aboutsummaryrefslogtreecommitdiffstats
path: root/modules/cache/cache_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/cache/cache_test.go')
-rw-r--r--modules/cache/cache_test.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/cache/cache_test.go b/modules/cache/cache_test.go
index 0c68cc26ee..e0b82f86f2 100644
--- a/modules/cache/cache_test.go
+++ b/modules/cache/cache_test.go
@@ -34,6 +34,18 @@ func TestNewContext(t *testing.T) {
assert.Nil(t, con)
}
+func TestTest(t *testing.T) {
+ defaultCache = nil
+ _, err := Test()
+ assert.Error(t, err)
+
+ createTestCache()
+ elapsed, err := Test()
+ assert.NoError(t, err)
+ // mem cache should take from 300ns up to 1ms on modern hardware ...
+ assert.Less(t, elapsed, SlowCacheThreshold)
+}
+
func TestGetCache(t *testing.T) {
createTestCache()