fix(hashline-edit): address Cubic review issues - boundary echo, chunking dedup, empty stream alignment
- Fix single-line anchor-echo stripping to trigger empty-insert validation - Fix trailing boundary-echo stripping for boundary-only payloads - Extract shared chunking logic to hashline-chunk-formatter - Align empty stream/iterable handling with formatHashLines - Add regression tests for all fixes
This commit is contained in:
@@ -116,4 +116,26 @@ describe("streamHashLinesFrom*", () => {
|
||||
//#then
|
||||
expect(result).toBe(formatHashLines(content))
|
||||
})
|
||||
|
||||
it("matches formatHashLines for empty utf8 stream input", async () => {
|
||||
//#given
|
||||
const content = ""
|
||||
|
||||
//#when
|
||||
const result = await collectStream(streamHashLinesFromUtf8(utf8Chunks(content, 1), { maxChunkLines: 1 }))
|
||||
|
||||
//#then
|
||||
expect(result).toBe(formatHashLines(content))
|
||||
})
|
||||
|
||||
it("matches formatHashLines for empty line iterable input", async () => {
|
||||
//#given
|
||||
const content = ""
|
||||
|
||||
//#when
|
||||
const result = await collectStream(streamHashLinesFromLines([], { maxChunkLines: 1 }))
|
||||
|
||||
//#then
|
||||
expect(result).toBe(formatHashLines(content))
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user