cultmesh-rs tests: say what the interop peer said when it dies early

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-11-28 05:33:00 +01:00
commit 278238cf68

View file

@ -506,11 +506,13 @@ impl Csharp {
}
let mut child = command.stdin(Stdio::piped()).stdout(Stdio::piped()).spawn().expect("dotnet runs the interop peer");
let mut lines = BufReader::new(child.stdout.take().unwrap()).lines();
let mut said = Vec::new();
let port = loop {
let line = lines.next().expect("the peer announces its port").unwrap();
let line = lines.next().unwrap_or_else(|| panic!("the peer ended without announcing its port; it said {said:?}")).unwrap();
if let Some(rest) = line.strip_prefix("listening ") {
break rest.trim().parse::<u16>().unwrap();
}
said.push(line);
};
Self { child, port }
}