mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-01 00:38:27 +01:00
Added 3 tests
This commit is contained in:
@@ -123,4 +123,29 @@ TEST_F(JsonParser_Object_Test, TwoStrings)
|
||||
sizeMustBe(2);
|
||||
keyMustHaveValue("key1", "value1");
|
||||
keyMustHaveValue("key2", "value2");
|
||||
}
|
||||
|
||||
TEST_F(JsonParser_Object_Test, TwoStringsSpaceBeforeComma)
|
||||
{
|
||||
whenInputIs("{\"key1\":\"value1\" ,\"key2\":\"value2\"}");
|
||||
parseMustSucceed();
|
||||
sizeMustBe(2);
|
||||
keyMustHaveValue("key1", "value1");
|
||||
keyMustHaveValue("key2", "value2");
|
||||
}
|
||||
|
||||
TEST_F(JsonParser_Object_Test, TwoStringsSpaceAfterComma)
|
||||
{
|
||||
whenInputIs("{\"key1\":\"value1\" ,\"key2\":\"value2\"}");
|
||||
parseMustSucceed();
|
||||
sizeMustBe(2);
|
||||
keyMustHaveValue("key1", "value1");
|
||||
keyMustHaveValue("key2", "value2");
|
||||
}
|
||||
|
||||
TEST_F(JsonParser_Object_Test, EndingWithAComma)
|
||||
{
|
||||
whenInputIs("{\"key1\":\"value1\",}");
|
||||
parseMustFail();
|
||||
sizeMustBe(0);
|
||||
}
|
||||
Reference in New Issue
Block a user