Skip to content

Commit 331ba49

Browse files
committed
style: format custom route regression fixes
1 parent 8587cfa commit 331ba49

3 files changed

Lines changed: 12 additions & 6 deletions

File tree

src/server/http_server.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ void HttpServerWrapper::set_custom_routes(std::vector<fastmcpp::CustomRoute> rou
1616
{
1717
route.method = fastmcpp::util::http::normalize_custom_route_method(std::move(route.method));
1818
if (route.path.empty() || route.path.front() != '/')
19-
throw ValidationError("CustomRoute.path must start with '/' (got '" + route.path + "')");
19+
throw ValidationError("CustomRoute.path must start with '/' (got '" + route.path +
20+
"')");
2021
if (!route.handler)
2122
throw ValidationError("CustomRoute.handler is required");
2223
}

tests/app/custom_route_forwarding.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ static int test_register_replaces_duplicate()
6868
app.add_custom_route(make_route("get", "/x", "first"));
6969
app.add_custom_route(make_route("GET", "/x", "second"));
7070
ASSERT_EQ(app.custom_routes().size(), 1u, "still one route");
71-
ASSERT_EQ(app.custom_routes().front().method, std::string("GET"), "method normalized to uppercase");
71+
ASSERT_EQ(app.custom_routes().front().method, std::string("GET"),
72+
"method normalized to uppercase");
7273
auto resp = app.custom_routes().front().handler({"GET", "/x", "", {}});
7374
ASSERT_EQ(resp.body, std::string("second"), "second handler wins");
7475
std::cout << " PASS" << std::endl;

tests/providers/catalog_dedup.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,8 @@ static int test_get_tool_catalog_preserves_existing_object_meta()
264264
ASSERT_EQ(result.size(), 1u, "one tool");
265265
ASSERT_TRUE(result[0].meta().has_value(), "meta present");
266266
ASSERT_TRUE(result[0].meta()->is_object(), "object meta retained");
267-
ASSERT_TRUE((*result[0].meta()).value("custom", std::string{}) == "value", "custom key preserved");
267+
ASSERT_TRUE((*result[0].meta()).value("custom", std::string{}) == "value",
268+
"custom key preserved");
268269
ASSERT_TRUE((*result[0].meta())["fastmcp"].value("source", std::string{}) == "canonical",
269270
"existing fastmcp fields preserved");
270271
auto versions = (*result[0].meta())["fastmcp"]["versions"].get<std::vector<std::string>>();
@@ -360,7 +361,8 @@ static int test_metadata_survives_tool_info_and_mcp_serialization()
360361

361362
static int test_non_object_meta_does_not_break_tool_info_or_mcp_serialization()
362363
{
363-
std::cout << " test_non_object_meta_does_not_break_tool_info_or_mcp_serialization..." << std::endl;
364+
std::cout << " test_non_object_meta_does_not_break_tool_info_or_mcp_serialization..."
365+
<< std::endl;
364366

365367
auto v1 = make_tool("greet", "1");
366368
auto v3 = make_tool("greet", "3");
@@ -375,9 +377,11 @@ static int test_non_object_meta_does_not_break_tool_info_or_mcp_serialization()
375377
auto tools = app.list_all_tools_info();
376378
ASSERT_EQ(tools.size(), 1u, "deduped tool list");
377379
ASSERT_TRUE(tools[0]._meta.has_value(), "tool info carries _meta");
378-
ASSERT_TRUE((*tools[0]._meta).is_object(), "non-object meta coerced before tool info serialization");
380+
ASSERT_TRUE((*tools[0]._meta).is_object(),
381+
"non-object meta coerced before tool info serialization");
379382
ASSERT_TRUE((*tools[0]._meta).contains("fastmcp"), "fastmcp block present in tool info");
380-
ASSERT_TRUE((*tools[0]._meta)["fastmcp"].contains("versions"), "versions surfaced in tool info");
383+
ASSERT_TRUE((*tools[0]._meta)["fastmcp"].contains("versions"),
384+
"versions surfaced in tool info");
381385

382386
auto handler = mcp::make_mcp_handler(app);
383387
Json req = {{"jsonrpc", "2.0"}, {"id", 1}, {"method", "tools/list"}};

0 commit comments

Comments
 (0)