From 64897d9083f1d3450444adf2c5ddfa8288161819 Mon Sep 17 00:00:00 2001 From: aibrahim-oai Date: Fri, 11 Jul 2025 12:09:42 -0700 Subject: [PATCH] Format SSE parser test --- codex-rs/core/src/chat_completions.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/codex-rs/core/src/chat_completions.rs b/codex-rs/core/src/chat_completions.rs index 1cc9effca3..8d671e8b3b 100644 --- a/codex-rs/core/src/chat_completions.rs +++ b/codex-rs/core/src/chat_completions.rs @@ -494,7 +494,9 @@ mod tests { let mut text = String::new(); for i in 0..2 { match &events[i] { - ResponseEvent::OutputItemDone(ResponseItem::Message { role, content }) if role == "assistant" => { + ResponseEvent::OutputItemDone(ResponseItem::Message { role, content }) + if role == "assistant" => + { if let Some(ContentItem::OutputText { text: t }) = content.get(0) { text.push_str(t); } @@ -505,7 +507,11 @@ mod tests { assert_eq!(text, "Hello world"); match &events[2] { - ResponseEvent::OutputItemDone(ResponseItem::FunctionCall { name, arguments, call_id }) => { + ResponseEvent::OutputItemDone(ResponseItem::FunctionCall { + name, + arguments, + call_id, + }) => { assert_eq!(name, "foo"); assert_eq!(call_id, "call1"); assert_eq!(arguments, "{\"a\": 1}");