( input: ReadonlyArray<Chunk.Chunk<string>> )
| 16 | }) |
| 17 | |
| 18 | const testSplitLines = ( |
| 19 | input: ReadonlyArray<Chunk.Chunk<string>> |
| 20 | ): Effect.Effect<readonly [ReadonlyArray<string>, ReadonlyArray<string>]> => { |
| 21 | const str = input.flatMap((chunk) => Chunk.toReadonlyArray(chunk).join("")).join("") |
| 22 | const expected = str.split(/\r?\n/) |
| 23 | return pipe( |
| 24 | Stream.fromChunks(...input), |
| 25 | Stream.splitLines, |
| 26 | Stream.runCollect, |
| 27 | Effect.map((chunk) => [expected, Chunk.toReadonlyArray(chunk)] as const) |
| 28 | ) |
| 29 | } |
| 30 | |
| 31 | describe("Stream", () => { |
| 32 | it.effect("split - should split properly", () => |
no test coverage detected