mcp: consolidate tests and streamline parameter parsing

This commit is contained in:
Adrià Arrufat
2026-03-02 22:18:02 +09:00
parent 3c858f522b
commit 6e7c8d7ae2
4 changed files with 35 additions and 81 deletions

View File

@@ -106,19 +106,3 @@ pub fn handleRead(server: *Server, arena: std.mem.Allocator, req: protocol.Reque
}
const testing = @import("../testing.zig");
test "resource_list contains expected resources" {
try testing.expect(resource_list.len >= 2);
try testing.expectString("mcp://page/html", resource_list[0].uri);
try testing.expectString("mcp://page/markdown", resource_list[1].uri);
}
test "ReadParams parsing" {
var arena = std.heap.ArenaAllocator.init(testing.allocator);
defer arena.deinit();
const aa = arena.allocator();
const raw = "{\"uri\": \"mcp://page/html\"}";
const parsed = try std.json.parseFromSlice(ReadParams, aa, raw, .{});
try testing.expectString("mcp://page/html", parsed.value.uri);
}