Upgrade to ttlcache/v3

This commit is contained in:
Deluan
2024-06-21 17:57:43 -04:00
parent 29b7b740ce
commit 3993c4d17f
7 changed files with 72 additions and 78 deletions
+5 -5
View File
@@ -11,11 +11,11 @@ import (
var _ = Describe("SimpleCache", func() {
var (
cache SimpleCache[string]
cache SimpleCache[string, string]
)
BeforeEach(func() {
cache = NewSimpleCache[string]()
cache = NewSimpleCache[string, string]()
})
Describe("Add and Get", func() {
@@ -67,7 +67,7 @@ var _ = Describe("SimpleCache", func() {
}
_, err := cache.GetWithLoader("key", loader)
Expect(err).To(MatchError("some error"))
Expect(err).To(HaveOccurred())
})
})
@@ -87,7 +87,7 @@ var _ = Describe("SimpleCache", func() {
Describe("Options", func() {
Context("when size limit is set", func() {
BeforeEach(func() {
cache = NewSimpleCache[string](Options{
cache = NewSimpleCache[string, string](Options{
SizeLimit: 2,
})
})
@@ -104,7 +104,7 @@ var _ = Describe("SimpleCache", func() {
Context("when default TTL is set", func() {
BeforeEach(func() {
cache = NewSimpleCache[string](Options{
cache = NewSimpleCache[string, string](Options{
DefaultTTL: 10 * time.Millisecond,
})
})