From f8bf48ded5ecfd2fd09a85e5b3dad8abf4b06da4 Mon Sep 17 00:00:00 2001 From: Dylan Hurd Date: Sat, 4 Oct 2025 02:29:21 -0700 Subject: [PATCH] fix windows line endings --- codex-rs/core/src/tools/mod.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/codex-rs/core/src/tools/mod.rs b/codex-rs/core/src/tools/mod.rs index 9fe38d6a59..69c6e3f851 100644 --- a/codex-rs/core/src/tools/mod.rs +++ b/codex-rs/core/src/tools/mod.rs @@ -407,6 +407,14 @@ mod tests { const TRUNCATED_STRUCTURED_EXPECTED: &str = include_str!("tests/truncated_structured_expected.txt"); + fn normalize_line_endings(input: &str) -> String { + if input.contains('\r') { + input.replace('\r', "") + } else { + input.to_string() + } + } + fn sample_output() -> ExecToolCallOutput { ExecToolCallOutput { exit_code: 0, @@ -480,6 +488,7 @@ mod tests { output.aggregated_output = StreamOutput::new(aggregated); let formatted = format_exec_output(&output, ExecResponseFormat::StructuredText); - assert_eq!(formatted, TRUNCATED_STRUCTURED_EXPECTED); + let expected = normalize_line_endings(TRUNCATED_STRUCTURED_EXPECTED); + assert_eq!(formatted, expected); } }