From 6b80cd6109233a9af8cea7710907dae7729cff7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Arrufat?= Date: Tue, 3 Mar 2026 14:19:36 +0900 Subject: [PATCH] mcp: namespace tests --- src/mcp/Server.zig | 2 +- src/mcp/protocol.zig | 10 +++++----- src/mcp/router.zig | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/mcp/Server.zig b/src/mcp/Server.zig index 360f2cb5..85f08152 100644 --- a/src/mcp/Server.zig +++ b/src/mcp/Server.zig @@ -83,7 +83,7 @@ pub fn sendError(self: *Self, id: std.json.Value, code: protocol.ErrorCode, mess }); } -test "MCP Integration: synchronous smoke test" { +test "MCP.Server - Integration: synchronous smoke test" { const allocator = testing.allocator; const app = testing.test_app; diff --git a/src/mcp/protocol.zig b/src/mcp/protocol.zig index db8f3c87..8532fd45 100644 --- a/src/mcp/protocol.zig +++ b/src/mcp/protocol.zig @@ -185,7 +185,7 @@ pub const JsonEscapingWriter = struct { const testing = @import("../testing.zig"); -test "protocol request parsing" { +test "MCP.protocol - request parsing" { const raw_json = \\{ \\ "jsonrpc": "2.0", @@ -221,7 +221,7 @@ test "protocol request parsing" { try testing.expectString("1.0.0", init_params.value.clientInfo.version); } -test "protocol response formatting" { +test "MCP.protocol - response formatting" { const response = Response{ .id = .{ .integer = 42 }, .result = .{ .string = "success" }, @@ -234,7 +234,7 @@ test "protocol response formatting" { try testing.expectString("{\"jsonrpc\":\"2.0\",\"id\":42,\"result\":\"success\"}", aw.written()); } -test "protocol error formatting" { +test "MCP.protocol - error formatting" { const response = Response{ .id = .{ .string = "abc" }, .@"error" = .{ @@ -250,7 +250,7 @@ test "protocol error formatting" { try testing.expectString("{\"jsonrpc\":\"2.0\",\"id\":\"abc\",\"error\":{\"code\":-32601,\"message\":\"Method not found\"}}", aw.written()); } -test "JsonEscapingWriter" { +test "MCP.protocol - JsonEscapingWriter" { var aw: std.Io.Writer.Allocating = .init(testing.allocator); defer aw.deinit(); @@ -263,7 +263,7 @@ test "JsonEscapingWriter" { try testing.expectString("hello\\n\\\"world\\\"", aw.written()); } -test "Tool serialization" { +test "MCP.protocol - Tool serialization" { const t = Tool{ .name = "test", .inputSchema = minify( diff --git a/src/mcp/router.zig b/src/mcp/router.zig index 368db601..e1076d6c 100644 --- a/src/mcp/router.zig +++ b/src/mcp/router.zig @@ -94,7 +94,7 @@ fn handleInitialize(server: *Server, req: protocol.Request) !void { const testing = @import("../testing.zig"); -test "handleMessage - synchronous unit tests" { +test "MCP.router - handleMessage - synchronous unit tests" { const allocator = testing.allocator; const app = testing.test_app;