forked from bblanchon/ArduinoJson
Test that adding the same value twice doesn't increase the size of the object
This commit is contained in:
1 parent
166bdd6919
commit
a2fc188526
10 files changed
+146
-32
No files matched your search
@@ -13,4 +13,17 @@ TEST(JsonObjectTests, WhenValueIsAdded_ThenSizeIsIncreasedByOne)
|
||||
|
||||
object["world"];
|
||||
EXPECT_EQ(2, object.size());
|
||||
}
|
||||
|
||||
TEST(JsonObjectTests, WhenTheSameValueIsAddedTwice_ThenSizeIsOnlyIncreasedByOne)
|
||||
{
|
||||
StaticJsonBuffer<42> json;
|
||||
|
||||
JsonObject object = json.createObject();
|
||||
|
||||
object["hello"];
|
||||
EXPECT_EQ(1, object.size());
|
||||
|
||||
object["hello"];
|
||||
EXPECT_EQ(1, object.size());
|
||||
}
|
||||
Reference in new issue
Block a user