| 64 | } |
| 65 | |
| 66 | std::function<Future<TestInt>()> NewBackgroundAsyncVectorIt(std::vector<TestInt> v, |
| 67 | bool sleep = true) { |
| 68 | auto pool = internal::GetCpuThreadPool(); |
| 69 | auto iterator = VectorIt(v); |
| 70 | auto slow_iterator = MakeTransformedIterator<TestInt, TestInt>( |
| 71 | std::move(iterator), [sleep](TestInt item) -> Result<TransformFlow<TestInt>> { |
| 72 | if (sleep) { |
| 73 | SleepABit(); |
| 74 | } |
| 75 | return TransformYield(item); |
| 76 | }); |
| 77 | |
| 78 | EXPECT_OK_AND_ASSIGN(auto background, |
| 79 | MakeBackgroundGenerator<TestInt>(std::move(slow_iterator), pool)); |
| 80 | return MakeTransferredGenerator(background, pool); |
| 81 | } |
| 82 | |
| 83 | template <typename T> |
| 84 | void AssertAsyncGeneratorMatch(std::vector<T> expected, AsyncGenerator<T> actual) { |
nothing calls this directly
no test coverage detected