Cotton code
26 lines · 1021 B · RustRaw
//! The two gates this group owes that no integration test can give it: the//! table it registers, and the totality the TypeScript gets from its type//! system.use super::handlers;#[test]fn registers_every_tool_it_claims_exactly_once() {    let mut names: Vec<&str> = handlers().iter().map(|(name, _)| *name).collect();    names.sort_unstable();    let before = names.len();    names.dedup();    assert_eq!(before, names.len(), "a tool is registered twice");    // 29, plus 4e's six OWNER-scope verbs of these same kinds:    // `respond_to_invite`, `archive_location`, `reorder_goal`, `delete_goal`,    // and the review round's `update_attendees` and `sync_device_contacts`.    assert_eq!(before, 35, "the group's tool count changed");    // Every name must be a tool the catalogue knows, or `call_tool` would    // never reach it.    for name in &names {        assert!(            crate::mcp::protocol::tool_by_name(name).is_some(),            "{name} is not in the catalogue"        );    }}