aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Feng Xiao <xfxyjwf@gmail.com>2017-09-19 22:35:27 -0700
committerGravatar GitHub <noreply@github.com>2017-09-19 22:35:27 -0700
commitcf1b29dec84f9a027dacdff094bbb6b10a110ed3 (patch)
treeae3bec38ff60fd2b5692f67746ad4c7037cfd61a
parentfa5a69e73b0dd667ff15062adbc170310d440ee9 (diff)
parentcb54caff01ef37b59889d6949e876b1ff6ee3a65 (diff)
Merge pull request #2377 from mcos/chore/conformance-null-tests
Conformance Tests for Null Timestamp and Duration JSON Values
-rw-r--r--conformance/conformance_test.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/conformance/conformance_test.cc b/conformance/conformance_test.cc
index b1ff6883..f1b92056 100644
--- a/conformance/conformance_test.cc
+++ b/conformance/conformance_test.cc
@@ -1995,6 +1995,10 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner,
R"({"repeatedDuration": ["1.5s", "-1.5s"]})",
"repeated_duration: {seconds: 1 nanos: 500000000}"
"repeated_duration: {seconds: -1 nanos: -500000000}");
+ RunValidJsonTest(
+ "DurationNull", REQUIRED,
+ R"({"optionalDuration": null})",
+ "");
ExpectParseFailureForJson(
"DurationMissingS", REQUIRED,
@@ -2064,6 +2068,10 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner,
"TimestampWithNegativeOffset", REQUIRED,
R"({"optionalTimestamp": "1969-12-31T16:00:00-08:00"})",
"optional_timestamp: {seconds: 0}");
+ RunValidJsonTest(
+ "TimestampNull", REQUIRED,
+ R"({"optionalTimestamp": null})",
+ "");
ExpectParseFailureForJson(
"TimestampJsonInputTooSmall", REQUIRED,