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

Function TestEntriesIteratorInInvalidState

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

Source from the content-addressed store, hash-verified

139}
140
141func TestEntriesIteratorInInvalidState(t *testing.T) {
142 t.Parallel()
143
144 // given
145 cache, _ := New(context.Background(), Config{
146 Shards: 1,
147 LifeWindow: time.Second,
148 MaxEntriesInWindow: 1,
149 MaxEntrySize: 256,
150 })
151
152 // when
153 iterator := cache.Iterator()
154
155 // then
156 _, err := iterator.Value()
157 assertEqual(t, ErrInvalidIteratorState, err)
158 assertEqual(t, "Iterator is in invalid state. Use SetNext() to move to next position", err.Error())
159}
160
161func TestEntriesIteratorParallelAdd(t *testing.T) {
162 bc, err := New(context.Background(), DefaultConfig(1*time.Minute))

Callers

nothing calls this directly

Calls 5

NewFunction · 0.85
IteratorMethod · 0.80
assertEqualFunction · 0.70
ValueMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…