MCPcopy Create free account
hub / github.com/bytedance/sonic-cpp / TEST

Function TEST

tests/error_test.cpp:27–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25namespace {
26using namespace sonic_json;
27TEST(Errors, Parse) {
28 std::string json = R"("hello\g")";
29 Document dom;
30 dom.Parse(json);
31 SonicError err = dom.GetParseError();
32 EXPECT_EQ(err, kParseErrorEscapedFormat);
33 EXPECT_EQ(dom.GetErrorOffset(), 6);
34 std::cout << ErrorMsg(err) << std::endl;
35}
36
37TEST(Errors, Serialze) {
38 Document dom;

Callers

nothing calls this directly

Calls 4

ErrorMsgFunction · 0.85
ParseMethod · 0.80
GetParseErrorMethod · 0.80
GetErrorOffsetMethod · 0.80

Tested by

no test coverage detected