mirror of
https://github.com/CrowCpp/Crow.git
synced 2026-01-18 16:31:17 +01:00
added test for issue #1042
This commit is contained in:
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user