Skip to content

Commit

Permalink
Fix missing inserted lines at the end of hunk in unified diffs
Browse files Browse the repository at this point in the history
Fixes #50
  • Loading branch information
banga committed Jun 27, 2024
1 parent 0796ad1 commit ee1bb51
Show file tree
Hide file tree
Showing 3 changed files with 232 additions and 35 deletions.
152 changes: 152 additions & 0 deletions src/__snapshots__/index.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,25 @@ Date: Sun Apr 11 10:39:17 2021 -0700
"
`;
exports[`inlineChangesHighlighted diff from issue #50 1`] = `
"
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
■■ file1
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
@@ -1 +1,2 @@
1 - This is file1
2 No newline at end of file 1 No newline at end of file
2 + This is file1
3 + Experimental change
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
■■ file2
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
@@ -1 +1,2 @@
1 + All good
1 This is file2 2 This is file2
"
`;
exports[`inlineChangesHighlighted empty 1`] = `
"
"
Expand Down Expand Up @@ -615,6 +634,25 @@ Date: Sun Apr 11 10:39:17 2021 -0700
"
`;
exports[`splitWithWrapping diff from issue #50 1`] = `
"
────────────────────────────────────────────────────────────────────────────────
■■ file1
────────────────────────────────────────────────────────────────────────────────
@@ -1 +1,2 @@
1 - This is file1
2 No newline at end of file 1 No newline at end of file
2 + This is file1
3 + Experimental change
────────────────────────────────────────────────────────────────────────────────
■■ file2
────────────────────────────────────────────────────────────────────────────────
@@ -1 +1,2 @@
1 + All good
1 This is file2 2 This is file2
"
`;
exports[`splitWithWrapping empty 1`] = `
"
"
Expand Down Expand Up @@ -961,6 +999,25 @@ Date: Sun Apr 11 10:39:17 2021 -0700
"
`;
exports[`splitWithoutWrapping diff from issue #50 1`] = `
"
────────────────────────────────────────────────────────────────────────────────
■■ file1
────────────────────────────────────────────────────────────────────────────────
@@ -1 +1,2 @@
1 - This is file1
2 No newline at end of file 1 No newline at end of file
2 + This is file1
3 + Experimental change
────────────────────────────────────────────────────────────────────────────────
■■ file2
────────────────────────────────────────────────────────────────────────────────
@@ -1 +1,2 @@
1 + All good
1 This is file2 2 This is file2
"
`;
exports[`splitWithoutWrapping empty 1`] = `
"
"
Expand Down Expand Up @@ -1285,6 +1342,25 @@ Date: Sun Apr 11 10:39:17 2021 -0700
"
`;
exports[`syntaxHighlighted diff from issue #50 1`] = `
"
────────────────────────────────────────────────────────────────────────────────
■■ file1
────────────────────────────────────────────────────────────────────────────────
@@ -1 +1,2 @@
1 - This is file1
2 No newline at end of file 1 No newline at end of file
2 + This is file1
3 + Experimental change
────────────────────────────────────────────────────────────────────────────────
■■ file2
────────────────────────────────────────────────────────────────────────────────
@@ -1 +1,2 @@
1 + All good
1 This is file2 2 This is file2
"
`;
exports[`syntaxHighlighted empty 1`] = `
"
"
Expand Down Expand Up @@ -1535,18 +1611,34 @@ Date: Sun Apr 4 19:04:26 2021 -0700
────────────────────────────────────────────────────────────────────────────────
@@ -5 +5 @@
5 - "revision": ░░░░
5 + "revision": ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
@@ -8 +8 @@
8 - "revision": ░░░░
8 + "revision": ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
@@ -11 +11 @@
11 - "revision": ░░░░
11 + "revision": ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
@@ -16 +16 @@
16 - "version": "1.░░.░░░",
16 + "version": "1.░░.░",
@@ -17,0 +18 @@
18 + "rebuild": 0,
@@ -19,0 +21 @@
21 + "root_url": "https://homebrew.bintray.com/bottles",
@@ -20,0 +23,8 @@
23 + "arm64_big_sur": {
24 + "url": "https://homebrew.bintray.com/bottles/go-1.16.3.ar
25 + "sha256": "e7c1efdd09e951eb46d01a3200b01e7fa55ce285b75470
26 + },
27 + "big_sur": {
28 + "url": "https://homebrew.bintray.com/bottles/go-1.16.3.bi
29 + "sha256": "ea37f33fd27369612a3e4e6db6adc46db0e8bdf6fac133
30 + },
@@ -22,2 +32,2 @@
22 - "url": "https://homebrew.bintray.com/bottles/go-1.░░.░░░.
23 - "sha256": "░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
32 + "url": "https://homebrew.bintray.com/bottles/go-1.░░.░.ca
33 + "sha256": "░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
@@ -26,6 +36,2 @@
26 - "url": "https://homebrew.bintray.com/bottles/go-1.░░.░░░.
27 - "sha256": "░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
Expand Down Expand Up @@ -1602,6 +1694,25 @@ Date: Sun Apr 11 10:39:17 2021 -0700
"
`;
exports[`unifiedWithInlineChangesHighlighted diff from issue #50 1`] = `
"
────────────────────────────────────────────────────────────────────────────────
■■ file1
────────────────────────────────────────────────────────────────────────────────
@@ -1 +1,2 @@
1 - This is file1
2 No newline at end of file
2 + This is file1
3 + Experimental change
────────────────────────────────────────────────────────────────────────────────
■■ file2
────────────────────────────────────────────────────────────────────────────────
@@ -1 +1,2 @@
1 + All good
1 This is file2
"
`;
exports[`unifiedWithInlineChangesHighlighted empty 1`] = `
"
"
Expand Down Expand Up @@ -1862,20 +1973,42 @@ Date: Sun Apr 4 19:04:26 2021 -0700
────────────────────────────────────────────────────────────────────────────────
@@ -5 +5 @@
5 - "revision": null
5 + "revision": "ee2f8d3ba2976e50ef577d517bf175c94fbbb0dd"
@@ -8 +8 @@
8 - "revision": null
8 + "revision": "c4cf96857c050dfa4f65f52109862dc68e55f60a"
@@ -11 +11 @@
11 - "revision": null
11 + "revision": "504d4b93aa6eaf4fce1bf17c19f55828ad7229a4"
@@ -16 +16 @@
16 - "version": "1.14.2_1",
16 + "version": "1.16.3",
@@ -17,0 +18 @@
18 + "rebuild": 0,
@@ -19,0 +21 @@
21 + "root_url": "https://homebrew.bintray.com/bottles",
@@ -20,0 +23,8 @@
23 + "arm64_big_sur": {
24 + "url": "https://homebrew.bintray.com/bottles/go-1.16.3.ar
m64_big_sur.bottle.tar.gz",
25 + "sha256":
"e7c1efdd09e951eb46d01a3200b01e7fa55ce285b75470051be7fef34f4233ce"
26 + },
27 + "big_sur": {
28 + "url":
"https://homebrew.bintray.com/bottles/go-1.16.3.big_sur.bottle.tar.gz",
29 + "sha256":
"ea37f33fd27369612a3e4e6db6adc46db0e8bdf6fac1332bf51bafaa66d43969"
30 + },
@@ -22,2 +32,2 @@
22 - "url": "https://homebrew.bintray.com/bottles/go-1.14.2_1.
catalina.bottle.tar.gz",
23 - "sha256":
"15b5623471330edcc681d7f9d57b449660e6d4b98c7f67af67f4991fc75d61fc"
32 + "url": "https://homebrew.bintray.com/bottles/go-1.16.3.ca
talina.bottle.tar.gz",
33 + "sha256":
"69c28f5e60612801c66e51e93d32068f822b245ab83246cb6cb374572eb59e15"
@@ -26,6 +36,2 @@
26 - "url": "https://homebrew.bintray.com/bottles/go-1.14.2_1.
mojave.bottle.tar.gz",
Expand Down Expand Up @@ -1937,6 +2070,25 @@ Date: Sun Apr 11 10:39:17 2021 -0700
"
`;
exports[`unifiedWithWrapping diff from issue #50 1`] = `
"
────────────────────────────────────────────────────────────────────────────────
■■ file1
────────────────────────────────────────────────────────────────────────────────
@@ -1 +1,2 @@
1 - This is file1
2 No newline at end of file
2 + This is file1
3 + Experimental change
────────────────────────────────────────────────────────────────────────────────
■■ file2
────────────────────────────────────────────────────────────────────────────────
@@ -1 +1,2 @@
1 + All good
1 This is file2
"
`;
exports[`unifiedWithWrapping empty 1`] = `
"
"
Expand Down
Loading

0 comments on commit ee1bb51

Please sign in to comment.