| 25 | namespace { |
| 26 | using namespace sonic_json; |
| 27 | TEST(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 | |
| 37 | TEST(Errors, Serialze) { |
| 38 | Document dom; |
nothing calls this directly
no test coverage detected