Browse Source

Add conformance test for null value in list JSON

Jon Skeet 7 years ago
parent
commit
5140bae383
1 changed files with 18 additions and 0 deletions
  1. 18 0
      conformance/conformance_test.cc

+ 18 - 0
conformance/conformance_test.cc

@@ -2320,6 +2320,24 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner,
           }
         }
       )");
+  RunValidJsonTest(
+      "ValueAcceptListWithNull", REQUIRED,
+      R"({"optionalValue": ["x", null, "y"]})",
+      R"(
+        optional_value: {
+          list_value: {
+            values: {
+              string_value: "x"
+            }
+            values: {
+              null_value: NULL_VALUE
+            }
+            values: {
+              string_value: "y"
+            }
+          }
+        }
+      )");
   RunValidJsonTest(
       "ValueAcceptObject", REQUIRED,
       R"({"optionalValue": {"value": 1}})",