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

Function TestBuildMetaPayload_FallbackVersion

internal/mcp/meta_test.go:16–34  ·  view source on GitHub ↗

TestBuildMetaPayload_FallbackVersion guarantees an empty padVersion resolves to FallbackVersion — same invariant the handshake's serverInfo.version honours, so the meta document never reports a blank pad_version.

(t *testing.T)

Source from the content-addressed store, hash-verified

14// serverInfo.version honours, so the meta document never reports a
15// blank pad_version.
16func TestBuildMetaPayload_FallbackVersion(t *testing.T) {
17 got := BuildMetaPayload("")
18 if got.PadVersion != FallbackVersion {
19 t.Errorf("PadVersion = %q, want fallback %q", got.PadVersion, FallbackVersion)
20 }
21 if got.CmdhelpVersion != CmdhelpVersion {
22 t.Errorf("CmdhelpVersion = %q, want %q", got.CmdhelpVersion, CmdhelpVersion)
23 }
24 if got.ToolSurfaceVersion != ToolSurfaceVersion {
25 t.Errorf("ToolSurfaceVersion = %q, want %q", got.ToolSurfaceVersion, ToolSurfaceVersion)
26 }
27 if !got.ToolSurfaceStable {
28 t.Errorf("ToolSurfaceStable = false, want true")
29 }
30 if got.MCPProtocolVersion != AdvertisedMCPProtocolVersion {
31 t.Errorf("MCPProtocolVersion = %q, want %q",
32 got.MCPProtocolVersion, AdvertisedMCPProtocolVersion)
33 }
34}
35
36// TestAdvertisedProtocolVersion is what replaced a tautology. The old
37// assertion compared the payload against mcp.LATEST_PROTOCOL_VERSION while

Callers

nothing calls this directly

Calls 1

BuildMetaPayloadFunction · 0.85

Tested by

no test coverage detected