Documentation
¶
Overview ¶
storagetest package provides generic test cases for cache storage implementations.
Index ¶
- func BenchmarkSet[K loadingcache.KeyConstraint, V loadingcache.ValueConstraint](b *testing.B, storage loadingcache.CacheStorage[K, V], keys []K)
- func TestCloneStruct(t *testing.T, ...)
- func TestConsistency(t *testing.T, provider func() (loadingcache.CacheStorage[uint8, int8], func()))
- func TestDeepCopyStruct(t *testing.T, ...)
- func TestExpiration(t *testing.T, ...)
- func TestNegativeCache(t *testing.T, ...)
- type FixedClock
- type TestClonerStruct
- type TestDeepCopyerStruct
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BenchmarkSet ¶
func BenchmarkSet[K loadingcache.KeyConstraint, V loadingcache.ValueConstraint](b *testing.B, storage loadingcache.CacheStorage[K, V], keys []K)
BenchmarkSet benchmarks the Set method of the cache storage.
func TestCloneStruct ¶
func TestCloneStruct(t *testing.T, provider func() (loadingcache.CacheStorage[uint8, *TestClonerStruct], func()))
TestCloneStruct tests the cloning behavior of the cache storage.
func TestConsistency ¶
func TestConsistency(t *testing.T, provider func() (loadingcache.CacheStorage[uint8, int8], func()))
func TestDeepCopyStruct ¶
func TestDeepCopyStruct(t *testing.T, provider func() (loadingcache.CacheStorage[uint8, *TestDeepCopyerStruct], func()))
func TestExpiration ¶
func TestExpiration(t *testing.T, provider func(loadingcache.Clock) (loadingcache.CacheStorage[uint8, int8], func()))
func TestNegativeCache ¶
func TestNegativeCache(t *testing.T, provider func(loadingcache.Clock) (loadingcache.CacheStorage[uint8, int8], func()))
Types ¶
type FixedClock ¶
func (*FixedClock) Now ¶
func (c *FixedClock) Now() time.Time
type TestClonerStruct ¶
type TestClonerStruct struct {
// contains filtered or unexported fields
}
func (*TestClonerStruct) Clone ¶
func (s *TestClonerStruct) Clone() *TestClonerStruct
type TestDeepCopyerStruct ¶
type TestDeepCopyerStruct struct {
// contains filtered or unexported fields
}
func (*TestDeepCopyerStruct) DeepCopy ¶
func (s *TestDeepCopyerStruct) DeepCopy() *TestDeepCopyerStruct
Click to show internal directories.
Click to hide internal directories.