mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-01 08:48:30 +01:00
Added a test that adds a string value in a hash
This commit is contained in:
@@ -16,8 +16,20 @@ namespace JsonGeneratorTests
|
||||
assertJsonIs("{}");
|
||||
}
|
||||
|
||||
TEST_METHOD(OneString)
|
||||
{
|
||||
add("key", "value");
|
||||
assertJsonIs("{\"key\":\"value\"}");
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
template<typename T>
|
||||
void add(const char* key, T value)
|
||||
{
|
||||
hash.add(key, value);
|
||||
}
|
||||
|
||||
void assertJsonIs(const char* expected)
|
||||
{
|
||||
char buffer[256];
|
||||
|
||||
Reference in New Issue
Block a user