radicle-cli: fix tests for git ddiff on Windows.

I took the easy way of changing the tests to compare the lines
independently, as I suspect diffs should remain platform-specific.
This commit is contained in:
Fred Gobry 2026-06-07 15:12:25 -04:00 committed by Fintan Halpenny
parent d973a548b9
commit b12c0f0be4
2 changed files with 18 additions and 9 deletions

View File

@ -410,12 +410,15 @@ mod tests {
"/tests/data/ddiff_hunk.diff" "/tests/data/ddiff_hunk.diff"
))) )))
.unwrap(); .unwrap();
assert_eq!( // Lines are expected to match but line ending might differ depending
// on the platform.
assert!(
include_str!(concat!( include_str!(concat!(
env!("CARGO_MANIFEST_DIR"), env!("CARGO_MANIFEST_DIR"),
"/tests/data/ddiff_hunk.diff" "/tests/data/ddiff_hunk.diff"
)), ))
ddiff.to_unified_string().unwrap() .lines()
.eq(ddiff.to_unified_string().unwrap().lines())
); );
} }
} }

View File

@ -626,9 +626,12 @@ mod test {
"/tests/data/diff.diff" "/tests/data/diff.diff"
))) )))
.unwrap(); .unwrap();
assert_eq!( // Lines are expected to match but line ending might differ depending
include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/tests/data/diff.diff")), // on the platform.
diff_a.to_unified_string().unwrap() assert!(
include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/tests/data/diff.diff"))
.lines()
.eq(diff_a.to_unified_string().unwrap().lines())
); );
} }
@ -639,12 +642,15 @@ mod test {
"/tests/data/diff_body.diff" "/tests/data/diff_body.diff"
))) )))
.unwrap(); .unwrap();
assert_eq!( // Lines are expected to match but line ending might differ depending
// on the platform.
assert!(
include_str!(concat!( include_str!(concat!(
env!("CARGO_MANIFEST_DIR"), env!("CARGO_MANIFEST_DIR"),
"/tests/data/diff_body.diff" "/tests/data/diff_body.diff"
)), ))
diff_content.to_unified_string().unwrap() .lines()
.eq(diff_content.to_unified_string().unwrap().lines())
); );
} }