| 246 | } |
| 247 | |
| 248 | func TestWithSplitWithoutTriggersSplit(t *testing.T) { |
| 249 | ctx := context.Background() |
| 250 | fakeSplitter := &FakeRegionsSplitter{ |
| 251 | executedSplitsCount: 0, |
| 252 | } |
| 253 | strategy := &FakeSplitStrategy[string]{shouldSplit: false} |
| 254 | wrapper := &restore.PipelineRestorerWrapper[string]{PipelineRegionsSplitter: fakeSplitter} |
| 255 | |
| 256 | items := iter.FromSlice([]string{"item1", "item2", "item3"}) |
| 257 | splitIter := wrapper.WithSplit(ctx, items, strategy) |
| 258 | |
| 259 | for i := splitIter.TryNext(ctx); !i.Finished; i = splitIter.TryNext(ctx) { |
| 260 | } |
| 261 | |
| 262 | require.Equal(t, fakeSplitter.executedSplitsCount, 0) |
| 263 | } |
| 264 | func TestWithSplitAccumulateAndReset(t *testing.T) { |
| 265 | ctx := context.Background() |
| 266 | fakeSplitter := &FakeRegionsSplitter{} |