MCPcopy Create free account
hub / github.com/catboost/catboost / Y_UNIT_TEST

Function Y_UNIT_TEST

library/cpp/json/ut/json_reader_ut.cpp:91–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89
90Y_UNIT_TEST_SUITE(TJsonReaderTest) {
91 Y_UNIT_TEST(JsonReformatTest) {
92 TString data = "{\"null value\": null, \"intkey\": 10, \"double key\": 11.11, \"string key\": \"string\", \"array\": [1,2,3,\"TString\"], \"bool key\": true}";
93
94 TString result1, result2;
95 {
96 TStringStream in;
97 in << data;
98 TStringStream out;
99 TJsonWriter writer(&out, false);
100 TReformatCallbacks cb(writer);
101 ReadJson(&in, &cb);
102 writer.Flush();
103 result1 = out.Str();
104 }
105
106 {
107 TStringStream in;
108 in << result1;
109 TStringStream out;
110 TJsonWriter writer(&out, false);
111 TReformatCallbacks cb(writer);
112 ReadJson(&in, &cb);
113 writer.Flush();
114 result2 = out.Str();
115 }
116
117 UNIT_ASSERT_VALUES_EQUAL(result1, result2);
118 }
119
120 Y_UNIT_TEST(TJsonEscapedApostrophe) {
121 TString jsonString = "{ \"foo\" : \"bar\\'buzz\" }";

Callers

nothing calls this directly

Calls 15

GenerateDeepJsonArrayFunction · 0.70
GenerateDeepJsonDictFunction · 0.70
ReadJsonFunction · 0.50
ReadJsonTreeFunction · 0.50
GetArrayPointerFunction · 0.50
ReadJsonFastTreeFunction · 0.50
FlushMethod · 0.45
StrMethod · 0.45
GetIntegerMethod · 0.45
GetDoubleMethod · 0.45
GetBooleanMethod · 0.45
GetStringMethod · 0.45

Tested by

no test coverage detected