forked from bblanchon/ArduinoJson
Added a test with two strings in a hash table
This commit is contained in:
1 parent
1800a8e89e
commit
e26cea59e5
2 files changed
+10
-3
No files matched your search
@@ -15,21 +15,21 @@ namespace JsonGeneratorTests
|
|||||||
jsonIs("[]");
|
jsonIs("[]");
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_METHOD(AddNull)
|
TEST_METHOD(Null)
|
||||||
{
|
{
|
||||||
addValue((char*)0);
|
addValue((char*)0);
|
||||||
|
|
||||||
jsonIs("[null]");
|
jsonIs("[null]");
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_METHOD(AddOneString)
|
TEST_METHOD(OneString)
|
||||||
{
|
{
|
||||||
addValue("hello");
|
addValue("hello");
|
||||||
|
|
||||||
jsonIs("[\"hello\"]");
|
jsonIs("[\"hello\"]");
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_METHOD(AddTwoStrings)
|
TEST_METHOD(TwoStrings)
|
||||||
{
|
{
|
||||||
addValue("hello");
|
addValue("hello");
|
||||||
addValue("world");
|
addValue("world");
|
||||||
|
|||||||
@@ -22,6 +22,13 @@ namespace JsonGeneratorTests
|
|||||||
jsonIs("{\"key\":\"value\"}");
|
jsonIs("{\"key\":\"value\"}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_METHOD(TwoStrings)
|
||||||
|
{
|
||||||
|
add("key1", "value1");
|
||||||
|
add("key2", "value2");
|
||||||
|
jsonIs("{\"key1\":\"value1\",\"key2\":\"value2\"}");
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|||||||
Reference in new issue
Block a user