mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-21 22:42:25 +02: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