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

Function test_with_args

smallthinker/tests/test-chat-parser.cpp:189–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187 assert_equals(expected, args_paths.size() == 1 && args_paths[0].empty() ? js->value.get<std::string>() : js->value.dump());
188}
189static void test_with_args(const std::string & input, const std::string & expected, bool parse_as_partial = true, bool is_partial = true) {
190 common_chat_msg_parser builder(input, parse_as_partial, {});
191 auto js = builder.try_consume_json_with_dumped_args({{"args"}}, {});
192 assert_equals(true, js.has_value());
193 assert_equals(is_partial, js->is_partial);
194 assert_equals(expected, js->value.dump());
195}
196
197static void test_json_with_dumped_args_no_args() {
198 // Normal JSON, nothing to heal, nothing to dump

Callers 1

Calls 4

has_valueMethod · 0.80
dumpMethod · 0.80
assert_equalsFunction · 0.70

Tested by

no test coverage detected