(t *testing.T)
| 139 | } |
| 140 | |
| 141 | func 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 | |
| 161 | func TestEntriesIteratorParallelAdd(t *testing.T) { |
| 162 | bc, err := New(context.Background(), DefaultConfig(1*time.Minute)) |
nothing calls this directly
no test coverage detected
searching dependent graphs…