From 81def06144ca2102b135ecb43ca8da677344817c Mon Sep 17 00:00:00 2001 From: faumaray Date: Sat, 24 Oct 2026 15:29:30 +0300 Subject: [PATCH] Test that voice_options hands the version spec on as the spec After the seam merge VoiceOptions::client_version is the spec string that the engine resolves when it connects (docs/session-seam.md 17.3), and voice_options only resolves it eagerly to tell the user at once. The test pins both: no spec leaves None, a spec that resolves is passed on as written, one that does not is refused with the message. Co-Authored-By: Claude Sonnet 5.5 --- crates/voelin-ui-vm/src/servers/logic.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/voelin-ui-vm/src/servers/logic.rs b/crates/voelin-ui-vm/src/servers/logic.rs index c9b1b69..5085385 100644 --- a/crates/voelin-ui-vm/src/servers/logic.rs +++ b/crates/voelin-ui-vm/src/servers/logic.rs @@ -897,6 +897,13 @@ mod tests { assert_eq!(options.channel_password.as_deref(), Some("pw")); assert_eq!(options.token.as_deref(), Some("key")); assert!(options.audio); + // A bookmark without a version spec leaves the engine's default. + assert_eq!(options.client_version, None); + // A spec that resolves goes on as the spec: the engine resolves it + // when it connects. + b.client_version = Some("default".into()); + let options = voice_options(&b, None, None, None).unwrap(); + assert_eq!(options.client_version.as_deref(), Some("default")); b.client_version = Some("no such version".into()); let error = voice_options(&b, None, None, None).err().unwrap(); assert!(error.starts_with("Invalid client compatibility version"), "{error}");