We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2601bb0 commit cb90d4cCopy full SHA for cb90d4c
cache_internal_test.go
@@ -143,6 +143,30 @@ func TestDeleteExpired(t *testing.T) {
143
t.Errorf("want %d items but got %d", want, got)
144
}
145
})
146
+
147
+ t.Run("issue #64", func(t *testing.T) {
148
+ defer restore()
149
+ c := New[string, int]()
150
+ c.Set("1", 4, WithExpiration(0)) // These should not be expired
151
+ c.Set("2", 5, WithExpiration(-1)) // These should not be expired
152
+ c.Set("3", 6, WithExpiration(1*time.Hour))
153
154
+ want := true
155
+ _, ok := c.Get("1")
156
+ if ok != want {
157
+ t.Errorf("want %t but got %t", want, ok)
158
+ }
159
160
+ _, ok = c.Get("2")
161
162
163
164
+ _, ok = c.Get("3")
165
166
167
168
169
+ })
170
171
172
func max(x, y int) int {
0 commit comments