fix(test): the colon-vs-spec test did not compile
Committed and deployed while its test compile was failing: the verify step was `cargo test | grep -E "^error|test result" && git commit`, and grep exits 0 when it MATCHES, so finding the error is what let the commit proceed. The library built fine, so the deploy was sound, but the check that was supposed to gate it did the opposite of gating. The error itself was a borrow in a test closure; a plain fn fixes it. Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5
parent
d9c5300859
commit
c7c3eeab46
@@ -531,19 +531,17 @@ mod tests {
|
||||
/// would have refused a perfectly good independent judge.
|
||||
#[test]
|
||||
fn a_colon_in_the_model_name_is_not_a_missing_provider() {
|
||||
// What `resolve_provider` returns, in both cases.
|
||||
let routed = |spec: &str| spec.split_once(':').map(|(_, m)| m).unwrap_or(spec);
|
||||
let unrouted = |spec: &str| spec;
|
||||
// What `resolve_provider` returns in each case.
|
||||
fn routed(spec: &str) -> &str {
|
||||
spec.split_once(':').map(|(_, m)| m).unwrap_or(spec)
|
||||
}
|
||||
|
||||
for spec in ["local:ornith-fleet:9b", "glm:glm-4.7", "kimi:kimi-k2.7-code"] {
|
||||
assert_ne!(
|
||||
routed(spec),
|
||||
spec,
|
||||
"{spec} routed must not equal the whole spec"
|
||||
);
|
||||
assert_eq!(unrouted(spec), spec, "{spec} unrouted comes back whole");
|
||||
assert_ne!(routed(spec), spec, "{spec} routed must not equal the whole spec");
|
||||
}
|
||||
// And the one that made the naive check look correct for so long.
|
||||
// An unrecognised provider comes back WHOLE — the only true signal.
|
||||
assert_eq!(routed("nosuch"), "nosuch");
|
||||
// And the case that made the naive colon test look correct for so long.
|
||||
assert!(routed("local:ornith-fleet:9b").contains(':'));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user