Selaa lähdekoodia

Added a test that adds a nested array to an array

Benoît Blanchon 11 vuotta sitten
vanhempi
sitoutus
aa6cf308db
1 muutettua tiedostoa jossa 10 lisäystä ja 0 poistoa
  1. 10 0
      JsonGeneratorTests/JsonArrayTests.cpp

+ 10 - 0
JsonGeneratorTests/JsonArrayTests.cpp

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