Add overload JsonObjectSuscript::set(value, decimals) (issue #143)

This commit is contained in:
Benoit Blanchon
2015-10-30 22:29:47 +01:00
parent b9e3255c9e
commit 9f3ce18f06
6 changed files with 48 additions and 18 deletions

View File

@ -46,6 +46,14 @@ TEST_(StoreDouble) {
EXPECT_FALSE(_object["hello"].is<long>());
}
TEST_(StoreDoubleWithDigits) {
_object.set("hello", 123.45, 2);
EXPECT_EQ(123.45, _object["hello"].as<double>());
EXPECT_TRUE(_object["hello"].is<double>());
EXPECT_FALSE(_object["hello"].is<long>());
}
TEST_(StoreBoolean) {
_object.set("hello", true);