(t *testing.T)
| 119 | } |
| 120 | |
| 121 | func 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 | |
| 141 | func TestEntriesIteratorInInvalidState(t *testing.T) { |
| 142 | t.Parallel() |