diff options
author | egoroveug <egoroveug@yandex-team.ru> | 2022-02-10 16:50:25 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:25 +0300 |
commit | 3765cd96a63a8b9571d48c480806ce35989ca19e (patch) | |
tree | 7812e2c79af8114bfd003eb33a983891eddafa84 /library/cpp/json/writer/json_ut.cpp | |
parent | ec545677cb3d75384c18bb2307a912b4d0e7bbb1 (diff) | |
download | ydb-3765cd96a63a8b9571d48c480806ce35989ca19e.tar.gz |
Restoring authorship annotation for <egoroveug@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/json/writer/json_ut.cpp')
-rw-r--r-- | library/cpp/json/writer/json_ut.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/library/cpp/json/writer/json_ut.cpp b/library/cpp/json/writer/json_ut.cpp index 9980555683..ddb70f198d 100644 --- a/library/cpp/json/writer/json_ut.cpp +++ b/library/cpp/json/writer/json_ut.cpp @@ -186,25 +186,25 @@ Y_UNIT_TEST_SUITE(JsonWriter) { buf.WriteString("</>"); UNIT_ASSERT_STRINGS_EQUAL("\"\\u003C/\\u003E\"", buf.Str()); } - + Y_UNIT_TEST(FloatFormatting) { - NJsonWriter::TBuf buf(NJsonWriter::HEM_DONT_ESCAPE_HTML); - buf.BeginList() - .WriteFloat(0.12345678987654321f) - .WriteDouble(0.12345678987654321) - .WriteFloat(0.315501, PREC_NDIGITS, 3) - .WriteFloat(244.13854, PREC_NDIGITS, 4) - .WriteFloat(10385.8324, PREC_POINT_DIGITS, 2) - .BeginObject() + NJsonWriter::TBuf buf(NJsonWriter::HEM_DONT_ESCAPE_HTML); + buf.BeginList() + .WriteFloat(0.12345678987654321f) + .WriteDouble(0.12345678987654321) + .WriteFloat(0.315501, PREC_NDIGITS, 3) + .WriteFloat(244.13854, PREC_NDIGITS, 4) + .WriteFloat(10385.8324, PREC_POINT_DIGITS, 2) + .BeginObject() .WriteKey("1") .WriteDouble(1111.71, PREC_POINT_DIGITS, 0) .WriteKey("2") .WriteDouble(1111.71, PREC_NDIGITS, 1) - .EndObject() + .EndObject() .EndList(); - const char exp[] = "[0.123457,0.1234567899,0.316,244.1,10385.83,{\"1\":1112,\"2\":1e+03}]"; - UNIT_ASSERT_STRINGS_EQUAL(exp, buf.Str()); - } + const char exp[] = "[0.123457,0.1234567899,0.316,244.1,10385.83,{\"1\":1112,\"2\":1e+03}]"; + UNIT_ASSERT_STRINGS_EQUAL(exp, buf.Str()); + } Y_UNIT_TEST(NanFormatting) { { |