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 <noreply@anthropic.com>
This commit is contained in:
1 parent
d677273f06
commit
81def06144
1 file changed
+7
@@ -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}");
|
||||
|
||||
Reference in new issue
Block a user