Parcourir la source

Added a test that adds a nested array to an array

Benoît Blanchon il y a 11 ans
Parent
commit
aa6cf308db
1 fichiers modifiés avec 10 ajouts et 0 suppressions
  1. 10 0
      JsonGeneratorTests/JsonArrayTests.cpp

+ 10 - 0
JsonGeneratorTests/JsonArrayTests.cpp

@@ -111,6 +111,16 @@ namespace JsonGeneratorTests
             AssertJsonIs("[[]]");
         }
 
+        TEST_METHOD(AddOneNestedArrayWithOneItem)
+        {
+            JsonArray<1> nestedArray;
+            nestedArray.add(3.14);
+
+            arr.add(nestedArray);
+
+            AssertJsonIs("[[3.14]]");
+        }
+
         void AssertJsonIs(const char* expected)
         {      
             char buffer[256];