MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / assert_msg_equals

Function assert_msg_equals

smallthinker/tests/test-chat.cpp:148–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146 }
147}
148static void assert_msg_equals(const common_chat_msg & expected, const common_chat_msg & actual) {
149 assert_equals(expected.role, actual.role);
150 assert_equals(expected.content, actual.content);
151 assert_equals(expected.content_parts.size(), actual.content_parts.size());
152 for (size_t i = 0; i < expected.content_parts.size(); i++) {
153 const auto & expected_part = expected.content_parts[i];
154 const auto & actual_part = actual.content_parts[i];
155 assert_equals(expected_part.type, actual_part.type);
156 assert_equals(expected_part.text, actual_part.text);
157 }
158 assert_equals(expected.reasoning_content, actual.reasoning_content);
159 assert_equals(expected.tool_calls.size(), actual.tool_calls.size());
160 for (size_t i = 0; i < expected.tool_calls.size(); i++) {
161 const auto & expected_tool_call = expected.tool_calls[i];
162 const auto & actual_tool_call = actual.tool_calls[i];
163 assert_equals(expected_tool_call.name, actual_tool_call.name);
164 assert_equals(renormalize_json(expected_tool_call.arguments), renormalize_json(actual_tool_call.arguments));
165 assert_equals(expected_tool_call.id, actual_tool_call.id);
166 }
167}
168
169common_chat_tool special_function_tool {
170 /* .name = */ "special_function",

Callers 3

test_templatesFunction · 0.85

Calls 3

renormalize_jsonFunction · 0.85
assert_equalsFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected