Test that size doesn't change when remove() is called with an invalid key

This commit is contained in:
Benoit Blanchon
2014-09-30 17:07:29 +02:00
parent 3d9e40a3a8
commit d2e1b241be

View File

@ -44,6 +44,16 @@ TEST_F(JsonObjectTests, Shrink_WhenValuesAreRemoved)
EXPECT_EQ(0, object.size());
}
TEST_F(JsonObjectTests, DoNotShrink_WhenRemoveIsCalledWithAWrongKey)
{
object["hello"];
object["world"];
object.remove(":-P");
EXPECT_EQ(2, object.size());
}
TEST_F(JsonObjectTests, CanStoreIntegers)
{
object["hello"] = 123;