| 153 | |
| 154 | // merge() accepts string sources (normalized via from()) |
| 155 | async function testMergeStringSources() { |
| 156 | const batches = []; |
| 157 | for await (const batch of merge('hello', 'world')) { |
| 158 | batches.push(batch); |
| 159 | } |
| 160 | // Each string becomes a single-batch source |
| 161 | assert.strictEqual(batches.length >= 2, true); |
| 162 | const combined = new TextDecoder().decode(Buffer.concat(batches.flat())); |
| 163 | // Both strings should appear (order may vary) |
| 164 | assert.ok(combined.includes('hello')); |
| 165 | assert.ok(combined.includes('world')); |
| 166 | } |
| 167 | |
| 168 | // merge() accepts object-like sources that are normalized via from() |
| 169 | async function testMergeObjectLikeSources() { |