Skip to content
This repository was archived by the owner on May 20, 2026. It is now read-only.

Commit e202a41

Browse files
authored
nes: patch-based: test: ensure trailing newline is no issue (#4427)
1 parent 539d2dc commit e202a41

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/extension/xtab/test/node/xtabCustomDiffPatchResponseHandler.spec.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,17 @@ describe('XtabCustomDiffPatchResponseHandler', () => {
2525
expect(patches).toEqual(patchText);
2626
});
2727

28+
it('should parse a simple patch correctly despite trailing newline', async () => {
29+
const patchText = `file1.txt:10
30+
-Old line 1
31+
-Old line 2
32+
+New line 1
33+
+New line 2
34+
`;
35+
const patches = await collectPatches(patchText);
36+
expect(patches).toEqual(patchText.trim());
37+
});
38+
2839
it('should parse a simple patch correctly', async () => {
2940
const patchText = `/absolutePath/to/my_file.ts:1
3041
-Old line 1

0 commit comments

Comments
 (0)