@@ -142,52 +142,52 @@ namespace JsonSortByKey
142142 auto result = m_jsonHandler.SortJsonByKey (inputJson, {}, {}, ' ' , 2 );
143143
144144 ASSERT_TRUE (result.success );
145- ASSERT_EQ (result.response , " {\n \" big\" : 12345678901234567890,\n \" pi\" : 3.141592653589793238,\n \" tiny\" : 1e-14,\n \" tiny2\" : 0.00000000000001,\n \" z\" : \" last\"\n }" );
145+ ASSERT_EQ (
146+ result.response ,
147+ " {\n \" big\" : 12345678901234567890,\n \" pi\" : 3.141592653589793238,\n \" tiny\" : 1e-14,\n \" tiny2\" : 0.00000000000001,\n \" z\" : \" last\"\n }" );
146148 }
147149
148150 TEST_F (JsonSortByKeyTest, TestSortJsonByKey_NumberFormats_Success)
149151 {
150152 // Verify all valid JSON number notations survive sort-by-key roundtrip exactly
151153 // (synced with RapidJSON's Document.RawNumberRoundtrip_NumberFormats test).
152- std::string inputJson =
153- R"( {"neg_frac": -0.5,)"
154- R"( "int": 42,)"
155- R"( "neg": -17,)"
156- R"( "zero": 0,)"
157- R"( "frac": 3.14,)"
158- R"( "exp_lower": 1e10,)"
159- R"( "exp_upper": 1E10,)"
160- R"( "exp_plus": 1e+10,)"
161- R"( "exp_neg": 1e-10,)"
162- R"( "exp_frac": 1.5e3,)"
163- R"( "huge_int": 99999999999999999999,)"
164- R"( "huge_neg": -99999999999999999999,)"
165- R"( "tiny_exp": 1e-308,)"
166- R"( "tiny_frac": 0.000000000000000001,)"
167- R"( "leading_zero_frac": 0.123})" ;
168- auto result = m_jsonHandler.SortJsonByKey (inputJson, {}, {}, ' ' , 2 );
154+ std::string inputJson = R"( {"neg_frac": -0.5,)"
155+ R"( "int": 42,)"
156+ R"( "neg": -17,)"
157+ R"( "zero": 0,)"
158+ R"( "frac": 3.14,)"
159+ R"( "exp_lower": 1e10,)"
160+ R"( "exp_upper": 1E10,)"
161+ R"( "exp_plus": 1e+10,)"
162+ R"( "exp_neg": 1e-10,)"
163+ R"( "exp_frac": 1.5e3,)"
164+ R"( "huge_int": 99999999999999999999,)"
165+ R"( "huge_neg": -99999999999999999999,)"
166+ R"( "tiny_exp": 1e-308,)"
167+ R"( "tiny_frac": 0.000000000000000001,)"
168+ R"( "leading_zero_frac": 0.123})" ;
169+ auto result = m_jsonHandler.SortJsonByKey (inputJson, {}, {}, ' ' , 2 );
169170
170171 ASSERT_TRUE (result.success );
171172
172173 // Verify exact output with alphabetically sorted keys and preserved number text
173- std::string expected =
174- " {\n "
175- " \" exp_frac\" : 1.5e3,\n "
176- " \" exp_lower\" : 1e10,\n "
177- " \" exp_neg\" : 1e-10,\n "
178- " \" exp_plus\" : 1e+10,\n "
179- " \" exp_upper\" : 1E10,\n "
180- " \" frac\" : 3.14,\n "
181- " \" huge_int\" : 99999999999999999999,\n "
182- " \" huge_neg\" : -99999999999999999999,\n "
183- " \" int\" : 42,\n "
184- " \" leading_zero_frac\" : 0.123,\n "
185- " \" neg\" : -17,\n "
186- " \" neg_frac\" : -0.5,\n "
187- " \" tiny_exp\" : 1e-308,\n "
188- " \" tiny_frac\" : 0.000000000000000001,\n "
189- " \" zero\" : 0\n "
190- " }" ;
174+ std::string expected = " {\n "
175+ " \" exp_frac\" : 1.5e3,\n "
176+ " \" exp_lower\" : 1e10,\n "
177+ " \" exp_neg\" : 1e-10,\n "
178+ " \" exp_plus\" : 1e+10,\n "
179+ " \" exp_upper\" : 1E10,\n "
180+ " \" frac\" : 3.14,\n "
181+ " \" huge_int\" : 99999999999999999999,\n "
182+ " \" huge_neg\" : -99999999999999999999,\n "
183+ " \" int\" : 42,\n "
184+ " \" leading_zero_frac\" : 0.123,\n "
185+ " \" neg\" : -17,\n "
186+ " \" neg_frac\" : -0.5,\n "
187+ " \" tiny_exp\" : 1e-308,\n "
188+ " \" tiny_frac\" : 0.000000000000000001,\n "
189+ " \" zero\" : 0\n "
190+ " }" ;
191191 ASSERT_EQ (result.response , expected);
192192 }
193193} // namespace JsonSortByKey
0 commit comments