Skip to content

Commit cfa254e

Browse files
committed
added test for issue #1042
1 parent 8642d98 commit cfa254e

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

tests/unittest.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,6 +1447,16 @@ TEST_CASE("json Incorrect move of wvalue class #953")
14471447
}
14481448
}
14491449

1450+
TEST_CASE("CrowJson, SmallNumber #1042")
1451+
{
1452+
crow::json::wvalue data;
1453+
const double smallnumber = 1e-10;
1454+
data["testValue"] = smallnumber;
1455+
std::string text = data.dump( 4);
1456+
const auto expected_text ="{\n \"testValue\": 1e-10\n}";
1457+
REQUIRE(text==expected_text);
1458+
}
1459+
14501460
TEST_CASE("template_basic")
14511461
{
14521462
auto t = crow::mustache::compile(R"---(attack of {{name}})---");

0 commit comments

Comments
 (0)