fixing tests

This commit is contained in:
Ahmed Ibrahim
2025-07-14 10:55:32 -07:00
parent aeb12fc569
commit 86be2a6b58
2 changed files with 3 additions and 6 deletions

View File

@@ -580,7 +580,7 @@ mod tests {
{"role":"system","content":prompt.get_full_instructions(&config.model)},
{"role":"user","content":"hi"},
{"role":"assistant","content":"ok"},
{"role":"assistant","tool_calls":[{"id":"c1","type":"function","function":{"name":"foo","arguments":"{}"}}]},
{"role":"assistant", "content": null, "tool_calls":[{"id":"c1","type":"function","function":{"name":"foo","arguments":"{}"}}]},
{"role":"tool","tool_call_id":"c1","content":"out"}
]);

View File

@@ -66,13 +66,10 @@ async fn chat_mode_stream_cli() {
.env("OPENAI_BASE_URL", format!("{}/v1", server.uri()));
let output = cmd.output().unwrap();
println!("Status: {}", output.status);
println!("Stdout:\n{}", String::from_utf8_lossy(&output.stdout));
println!("Stderr:\n{}", String::from_utf8_lossy(&output.stderr));
assert!(output.status.success());
let stdout = String::from_utf8_lossy(&output.stdout);
assert!(stdout.contains("hi"));
assert_eq!(stdout.matches("hi").count(), 1);
let hi_lines = stdout.lines().filter(|line| line.trim() == "hi").count();
assert_eq!(hi_lines, 1, "Expected exactly one line with 'hi'");
server.verify().await;
}