TinySkin/db/cache/fastcache_test.go
2023-09-12 22:09:28 +08:00

21 lines
299 B
Go

package cache
import (
"testing"
"time"
"github.com/samber/lo"
)
func TestFastCache(t *testing.T) {
f := NewFastCache(100000)
c := CacheHelp[string]{
Cache: f,
}
c.Put([]byte("123"), "123", time.Now().Add(10*time.Second))
if lo.Must(c.Get([]byte("123"))) != "123" {
t.FailNow()
}
}