added test for issue #1042

This commit is contained in:
Gulliver
2025-07-16 17:53:46 +02:00
parent 6ba7d7f167
commit 57b42536ee

View File

@@ -640,4 +640,14 @@ TEST_CASE("json Incorrect move of wvalue class #953", "[json]")
json["int_value"] = getValue(-500);
REQUIRE(json["int_value"].dump()=="-500");
}
}
TEST_CASE("SmallNumber #1042", "[json]")
{
crow::json::wvalue data;
const double smallnumber = 1e-10;
data["testValue"] = smallnumber;
std::string text = data.dump( 4);
const auto expected_text ="{\n \"testValue\": 1e-10\n}";
REQUIRE(text==expected_text);
}