Changed JsonArray tests to show the issue

This commit is contained in:
Benoit Blanchon
2014-08-04 09:22:45 +02:00
parent df52dceaa1
commit bc86ae800a
4 changed files with 25 additions and 19 deletions

View File

@ -124,13 +124,19 @@ namespace JsonGeneratorTests
TEST_METHOD(OneEmptyNestedArray)
{
addNested(JsonArray<1>());
JsonArray<1> nestedArray;
arr.add(nestedArray);
outputMustBe("[[]]");
}
TEST_METHOD(OneEmptyNestedHash)
{
addNested(JsonHashTable<1>());
JsonObject<1> nestedObject;
arr.add(nestedObject);
outputMustBe("[{}]");
}
@ -139,18 +145,13 @@ namespace JsonGeneratorTests
JsonArray<1> nestedArray;
nestedArray.add(1);
addNested(nestedArray);
arr.add(nestedArray);
outputMustBe("[[1]]");
}
private:
void addNested(Printable& value)
{
arr.add<Printable&>(value);
}
template<typename T>
void add(T value)
{