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)
| 79 | // External consumers (the future Pad Cloud remote MCP, third-party |
| 80 | // agents) pin against these — renames are a CmdhelpVersion bump. |
| 81 | func 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 / |
nothing calls this directly
no test coverage detected