MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / TestBuildMetaPayload_JSONFieldNames

Function TestBuildMetaPayload_JSONFieldNames

internal/mcp/meta_test.go:81–96  ·  view source on GitHub ↗

TestBuildMetaPayload_JSONFieldNames locks the wire-level field names. External consumers (the future Pad Cloud remote MCP, third-party agents) pin against these — renames are a CmdhelpVersion bump.

(t *testing.T)

Source from the content-addressed store, hash-verified

79// External consumers (the future Pad Cloud remote MCP, third-party
80// agents) pin against these — renames are a CmdhelpVersion bump.
81func TestBuildMetaPayload_JSONFieldNames(t *testing.T) {
82 body, err := json.Marshal(BuildMetaPayload("0.0.1"))
83 if err != nil {
84 t.Fatalf("marshal: %v", err)
85 }
86 var raw map[string]any
87 if err := json.Unmarshal(body, &raw); err != nil {
88 t.Fatalf("unmarshal: %v", err)
89 }
90 want := []string{"pad_version", "cmdhelp_version", "tool_surface_version", "tool_surface_stable", "mcp_protocol_version"}
91 for _, k := range want {
92 if _, ok := raw[k]; !ok {
93 t.Errorf("field %q missing from JSON; got keys %v", k, mapKeys(raw))
94 }
95 }
96}
97
98// TestRegisterMeta_ResourceRoundTrip drives the resource through the
99// real MCP HandleMessage path — the same code path Claude Desktop /

Callers

nothing calls this directly

Calls 3

BuildMetaPayloadFunction · 0.85
mapKeysFunction · 0.85
FatalfMethod · 0.80

Tested by

no test coverage detected