MCPcopy Create free account
hub / github.com/allegro/bigcache / TestEntriesIteratorWithAllShardsEmpty

Function TestEntriesIteratorWithAllShardsEmpty

iterator_test.go:121–139  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

119}
120
121func TestEntriesIteratorWithAllShardsEmpty(t *testing.T) {
122 t.Parallel()
123
124 // given
125 cache, _ := New(context.Background(), Config{
126 Shards: 1,
127 LifeWindow: time.Second,
128 MaxEntriesInWindow: 1,
129 MaxEntrySize: 256,
130 })
131
132 // when
133 iterator := cache.Iterator()
134
135 // then
136 if iterator.SetNext() {
137 t.Errorf("Iterator should not contain any elements")
138 }
139}
140
141func TestEntriesIteratorInInvalidState(t *testing.T) {
142 t.Parallel()

Callers

nothing calls this directly

Calls 3

NewFunction · 0.85
IteratorMethod · 0.80
SetNextMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…