D: share tool-name fixture and dedupe MCP peer tests

This commit is contained in:
ari committed 2026-10-19 22:59:49 -04:00
1 parent d1bec4a3d8
commit e2c553dbe4
3 files changed
+32 -42

No files matched your search

+14
View File
@@ -43,6 +43,20 @@ const PEER_AWARE: [&str; 8] = [
/// Tools that only exist while peers are configured.
const PEER_TOOLS: [&str; 2] = ["get_peer", "list_peers"];
/// Every tool visible while peers are configured, sorted by name.
///
/// Shared with the integration snapshot so the expected list is not copied
/// into the test.
pub fn tool_names() -> Vec<&'static str> {
let mut names: Vec<&'static str> = PEER_AWARE
.iter()
.chain(PEER_TOOLS.iter())
.copied()
.collect();
names.sort_unstable();
names
}
/// The two list tools took no parameters before the peer argument existed, so
/// their schema carried no `$schema` key; `schemars` adds one to derived
/// parameters. Dropping it keeps the peers-off schema byte-identical.