[tests] accept platform line endings in merge-driver checks

This commit is contained in:
Chris Bookholt
2026-06-29 23:29:29 -07:00
parent 7372a52f39
commit 1e9193ced0
+8 -6
View File
@@ -82,9 +82,10 @@ fn apply_allows_clean_patch_with_selected_merge_driver() {
assert_eq!(result.exit_code, 0);
assert!(!result.cmd_for_log.contains("--3way"));
assert_eq!(
std::fs::read_to_string(root.join("file.txt")).expect("read file"),
"new\n"
let contents = std::fs::read_to_string(root.join("file.txt")).expect("read file");
assert!(
matches!(contents.as_str(), "new\n" | "new\r\n"),
"expected the patched contents with a platform line ending, got {contents:?}"
);
let (marker_code, _, _) = run(root, &["git", "config", "--get", "codex.mergeran"]);
assert_ne!(marker_code, 0, "merge driver must not run");
@@ -143,9 +144,10 @@ fn reverse_apply_allows_clean_patch_with_selected_merge_driver() {
assert_eq!(result.exit_code, 0);
assert!(!result.cmd_for_log.contains("--3way"));
assert_eq!(
std::fs::read_to_string(root.join("file.txt")).expect("read file"),
"old\n"
let contents = std::fs::read_to_string(root.join("file.txt")).expect("read file");
assert!(
matches!(contents.as_str(), "old\n" | "old\r\n"),
"expected the reverted contents with a platform line ending, got {contents:?}"
);
let (marker_code, _, _) = run(root, &["git", "config", "--get", "codex.mergeran"]);
assert_ne!(marker_code, 0, "merge driver must not run");