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:
parent
d973a548b9
commit
b12c0f0be4
|
|
@ -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())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue