Skip to content

Commit a41dd00

Browse files
weihanglobmwill
authored andcommitted
test(compat): update/remote redundant comments
1 parent 5844b82 commit a41dd00

2 files changed

Lines changed: 6 additions & 17 deletions

File tree

‎tests/compat/git/mod.rs‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,7 @@ fn path_ambiguous_suffix() {
127127
// split at 3: a/x vs b/x c/x → suffix `x` (len 1)
128128
// split at 7: a/x b/x vs c/x → suffix `x` (len 1)
129129
//
130-
// - git apply: rejects: "git diff header lacks filename information when
131-
// removing 1 leading pathname component")
132-
// - diffy: succeeds, picks first (leftmost) split
130+
// diffy succeeds (picks first/leftmost split); git apply rejects.
133131
#[test]
134132
fn fail_ambiguous_suffix_tie() {
135133
Case::git("fail_ambiguous_suffix_tie")
@@ -144,7 +142,6 @@ error: git diff header lacks filename information when removing 1 leading pathna
144142
}
145143

146144
// Both --- and +++ point to /dev/null.
147-
// git apply rejects: "dev/null: No such file or directory"
148145
#[test]
149146
fn fail_both_devnull() {
150147
Case::git("fail_both_devnull")
@@ -181,10 +178,7 @@ fn path_custom_prefix() {
181178
// Custom prefix without slash (e.g. `--src-prefix=foo --dst-prefix=bar`).
182179
//
183180
// Produces paths like `fooold.txt` / `barold.txt` with no `/` separator,
184-
// making strip impossible. Both git apply and diffy fail:
185-
// - git apply: "git diff header lacks filename information when removing 1
186-
// leading pathname component"
187-
// - diffy: paths don't match any input file
181+
// making strip impossible. Both git apply and diffy fail.
188182
#[test]
189183
fn fail_prefix_no_slash() {
190184
Case::git("fail_prefix_no_slash")
@@ -207,8 +201,7 @@ fn non_utf8_hunk_content() {
207201

208202
// Single-file patch with junk between hunks.
209203
//
210-
// - git apply: errors ("patch fragment without header")
211-
// - diffy: succeeds, ignores trailing junk (matches GNU patch behavior)
204+
// diffy succeeds (ignores trailing junk, matches GNU patch); git apply rejects.
212205
#[test]
213206
fn junk_between_hunks() {
214207
Case::git("junk_between_hunks")

‎tests/compat/gnu_patch/mod.rs‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,8 @@ fn missing_minus_header() {
5656

5757
// Empty file creation using unified diff format with empty hunk.
5858
//
59-
// Platform compatibility:
60-
// - Apple patch 2.0 (macOS/BSD): ✅ Accepts, creates empty file (0 bytes)
61-
// - GNU patch 2.8 (Linux): ❌ Rejects as "malformed patch at line 3"
62-
// - diffy: ✅ Accepts (with our current implementation)
59+
// diffy accepts (creates empty file); GNU patch rejects.
60+
// Apple patch 2.0 (macOS/BSD) also accepts.
6361
#[test]
6462
fn create_empty_file_unidiff() {
6563
Case::gnu_patch("create_empty_file_unidiff")
@@ -209,9 +207,7 @@ fn fail_truncated_file() {
209207

210208
// Patch with ---/+++ headers but no @@ hunks.
211209
//
212-
// - GNU patch: rejects ("Only garbage was found in the patch input")
213-
// - diffy: succeeds, parses as 1 patch with 0 hunks
214-
//
210+
// diffy succeeds (parses as 1 patch with 0 hunks); GNU patch rejects.
215211
// diffy allows 0-hunk patches for GitDiff mode where empty/binary files have no hunks.
216212
#[test]
217213
fn no_hunk() {

0 commit comments

Comments
 (0)