(t *testing.T)
| 78 | } |
| 79 | |
| 80 | func TestLRUCache_Evictions(t *testing.T) { |
| 81 | const maxItems = 2 |
| 82 | |
| 83 | reg := prometheus.NewPedanticRegistry() |
| 84 | lru, err := WrapWithLRUCache(NewMockCache(), "test", reg, maxItems, 2*time.Hour, log.NewNopLogger()) |
| 85 | require.NoError(t, err) |
| 86 | |
| 87 | lru.SetMultiAsync(map[string][]byte{ |
| 88 | "key_1": []byte("value_1"), |
| 89 | "key_2": []byte("value_2"), |
| 90 | "key_3": []byte("value_3"), |
| 91 | }, time.Minute) |
| 92 | |
| 93 | require.NoError(t, testutil.GatherAndCompare(reg, strings.NewReader(` |
| 94 | # HELP cache_memory_items_count Total number of items currently in the in-memory cache. |
| 95 | # TYPE cache_memory_items_count gauge |
| 96 | cache_memory_items_count{name="test"} 2 |
| 97 | `), "cache_memory_items_count")) |
| 98 | } |
| 99 | |
| 100 | func TestLRUCache_SetAdd(t *testing.T) { |
| 101 | const maxItems = 10 |
nothing calls this directly
no test coverage detected