storagetest

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

storagetest package provides generic test cases for cache storage implementations.

Index

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

type FixedClock struct {
	Time time.Time
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL