diff options
Diffstat (limited to 'cache_test.go')
-rw-r--r-- | cache_test.go | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/cache_test.go b/cache_test.go deleted file mode 100644 index 00f0ddf..0000000 --- a/cache_test.go +++ /dev/null @@ -1,32 +0,0 @@ -package main - -import ( - "testing" -) - -func Test_refreshCache(t *testing.T) { - initTestConf() - confObj.Mu.RLock() - prevtime := confObj.LastCache - confObj.Mu.RUnlock() - - t.Run("Cache Time Check", func(t *testing.T) { - refreshCache() - confObj.Mu.RLock() - newtime := confObj.LastCache - confObj.Mu.RUnlock() - - if !newtime.After(prevtime) || newtime == prevtime { - t.Errorf("Cache time did not update, check refreshCache() logic\n") - } - }) -} - -func Benchmark_refreshCache(b *testing.B) { - initTestConf() - b.ResetTimer() - - for i := 0; i < b.N; i++ { - refreshCache() - } -} |