| 89 | |
| 90 | Y_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\" }"; |
nothing calls this directly
no test coverage detected