MCPcopy
hub / github.com/SpecterOps/BloodHound / TestCache_NewCache

Function TestCache_NewCache

packages/go/cache/cache_test.go:71–87  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

69}
70
71func TestCache_NewCache(t *testing.T) {
72 var (
73 testValidSizes = []int{1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096}
74 )
75
76 t.Run("NewCache should fail if MaxSize is 0", func(t *testing.T) {
77 _, err := cache.NewCache(cache.Config{MaxSize: 0})
78 require.NotNil(t, err)
79 })
80
81 for _, size := range testValidSizes {
82 t.Run(fmt.Sprintf("NewCache should succeed if MaxSize is: %d", size), func(t *testing.T) {
83 _, err := cache.NewCache(cache.Config{MaxSize: 1})
84 require.Nil(t, err)
85 })
86 }
87}
88
89func TestCache_Set(t *testing.T) {
90 _, jsonErr := json.Marshal(invalidInputValue)

Callers

nothing calls this directly

Calls 2

NewCacheFunction · 0.92
RunMethod · 0.65

Tested by

no test coverage detected